Esempio n. 1
0
 public void RemoveServiceTest()
 {
     using (TestContainer testContainer = new TestContainer())
     {
         testContainer.AddService(typeof(SayHelloService), new ServiceCreatorCallback(SayHelloServiceCreatorCallback));
         Assert.AreEqual(1, testContainer.services.Count);
         testContainer.RemoveService(typeof(SayHelloService));
         Assert.AreEqual(0, testContainer.services.Count);
     }
 }
Esempio n. 2
0
 public void AddServiceWithCallback()
 {
     using (TestContainer testContainer = new TestContainer())
     {
         testContainer.AddService(typeof(SayHelloService), new ServiceCreatorCallback(SayHelloServiceCreatorCallback));
         Assert.AreEqual(1, testContainer.services.Count);
         SayHelloService sayHello = testContainer.GetService(typeof(SayHelloService)) as SayHelloService;
         Assert.IsNotNull(sayHello);
         Assert.IsTrue(serviceCallbackExecuted);
     }
 }
Esempio n. 3
0
 public void AddServiceWithCallback()
 {
     using (TestContainer testContainer = new TestContainer())
     {
         testContainer.AddService(typeof(SayHelloService), new ServiceCreatorCallback(SayHelloServiceCreatorCallback));
         Assert.AreEqual(1, testContainer.services.Count);
         SayHelloService sayHello = testContainer.GetService(typeof(SayHelloService)) as SayHelloService;
         Assert.IsNotNull(sayHello);
         Assert.IsTrue(serviceCallbackExecuted);
     }
 }
Esempio n. 4
0
 public void RemoveServiceTest()
 {
     using (TestContainer testContainer = new TestContainer())
     {
         testContainer.AddService(typeof(SayHelloService), new ServiceCreatorCallback(SayHelloServiceCreatorCallback));
         Assert.AreEqual(1, testContainer.services.Count);
         testContainer.RemoveService(typeof(SayHelloService));
         Assert.AreEqual(0, testContainer.services.Count);
     }
 }