Skip to content

Commit

Permalink
Added Unit Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AlonTalmi authored and hadashiA committed Mar 2, 2024
1 parent 4a23aa6 commit 0ffc81f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions VContainer/Assets/Tests/ContainerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,19 @@ public void RegisterFromFunc()
Assert.That(resolved, Is.InstanceOf<ServiceA>());
Assert.That(resolved.Service2, Is.InstanceOf<NoDependencyServiceA>());
}

[Test]
public void RegisterValueTypeFromFunc()
{
var builder = new ContainerBuilder();
builder.Register<GenericsService<bool>>(Lifetime.Transient);

builder.Register(_ => true, Lifetime.Scoped);

var container = builder.Build();
var resolved = container.Resolve<GenericsService<bool>>();
Assert.That(resolved.ParameterService, Is.True);
}

[Test]
public void RegisterFromFuncWithInterface()
Expand Down

0 comments on commit 0ffc81f

Please sign in to comment.