From 0ffc81ff491f80f7e47bd7373aad17a8f3076561 Mon Sep 17 00:00:00 2001 From: Alon Talmi Date: Wed, 15 Nov 2023 08:22:56 +0100 Subject: [PATCH] Added Unit Tests --- VContainer/Assets/Tests/ContainerTest.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/VContainer/Assets/Tests/ContainerTest.cs b/VContainer/Assets/Tests/ContainerTest.cs index 421d6a0f..11359414 100644 --- a/VContainer/Assets/Tests/ContainerTest.cs +++ b/VContainer/Assets/Tests/ContainerTest.cs @@ -328,6 +328,19 @@ public void RegisterFromFunc() Assert.That(resolved, Is.InstanceOf()); Assert.That(resolved.Service2, Is.InstanceOf()); } + + [Test] + public void RegisterValueTypeFromFunc() + { + var builder = new ContainerBuilder(); + builder.Register>(Lifetime.Transient); + + builder.Register(_ => true, Lifetime.Scoped); + + var container = builder.Build(); + var resolved = container.Resolve>(); + Assert.That(resolved.ParameterService, Is.True); + } [Test] public void RegisterFromFuncWithInterface()