public void Create_AutoDetect() { var dependencyService = new DependencyBuilder().EnableServiceAutoDetection(GetType().Assembly).Build().CreateScope(); var service = dependencyService.Create <First.RequiresUniqueSecond>(); Assert.NotNull(service); var first = Assert.IsType <First.RequiresUniqueSecond>(service); Assert.NotNull(first.UniqueSecond); Assert.IsType <Second.RequiresNone>(first.UniqueSecond); }
public void Create_Standard() { var dependencyService = new DependencyBuilder() .AddScoped <ISecond, Second.RequiresNone>() .Build().CreateScope(); var service = dependencyService.Create <First.RequiresSecond>(); Assert.NotNull(service); var first = Assert.IsType <First.RequiresSecond>(service); Assert.NotNull(first.Second); Assert.IsType <Second.RequiresNone>(first.Second); }