public void RegisterGenericTest() { using (Batman.Core.Bootstrapper.TinyIoC.Bootstrapper Bootstrapper = new Core.Bootstrapper.TinyIoC.Bootstrapper()) { Bootstrapper.Register <TestClass>(); Assert.NotEqual(null, Bootstrapper.Resolve <TestClass>()); } }
public void RegisterGenericObjectNamedTest() { using (Batman.Core.Bootstrapper.TinyIoC.Bootstrapper Bootstrapper = new Core.Bootstrapper.TinyIoC.Bootstrapper()) { Bootstrapper.Register<TestClass>(new TestClass { A = 10, B = 1.23f, C = "Testing" }, "Item1"); Assert.Equal(new TestClass { A = 10, B = 1.23f, C = "Testing" }, Bootstrapper.Resolve<TestClass>("Item1")); } }
public void RegisterGenericNamedTest() { using (Batman.Core.Bootstrapper.TinyIoC.Bootstrapper Bootstrapper = new Core.Bootstrapper.TinyIoC.Bootstrapper()) { Bootstrapper.Register<TestClass>("Item1"); Assert.NotEqual(null, Bootstrapper.Resolve<TestClass>("Item1")); } }
public void RegisterGenericFunctionTest() { using (Batman.Core.Bootstrapper.TinyIoC.Bootstrapper Bootstrapper = new Core.Bootstrapper.TinyIoC.Bootstrapper()) { Bootstrapper.Register<TestClass>(() => new TestClass { A = 10, B = 1.23f, C = "Testing" }); Assert.Equal(new TestClass { A = 10, B = 1.23f, C = "Testing" }, Bootstrapper.Resolve<TestClass>()); } }
public void RegisterGenericObjectTest() { using (Batman.Core.Bootstrapper.TinyIoC.Bootstrapper Bootstrapper = new Core.Bootstrapper.TinyIoC.Bootstrapper()) { Bootstrapper.Register <TestClass>(new TestClass { A = 10, B = 1.23f, C = "Testing" }); Assert.Equal(new TestClass { A = 10, B = 1.23f, C = "Testing" }, Bootstrapper.Resolve <TestClass>()); } }
public void RegisterGenericFunctionNamedTest() { using (Batman.Core.Bootstrapper.TinyIoC.Bootstrapper Bootstrapper = new Core.Bootstrapper.TinyIoC.Bootstrapper()) { Bootstrapper.Register <TestClass>(() => new TestClass { A = 10, B = 1.23f, C = "Testing" }, "Test1"); Assert.Equal(new TestClass { A = 10, B = 1.23f, C = "Testing" }, Bootstrapper.Resolve <TestClass>("Test1")); } }