Inheritance: ISimpleObject
 public void CustomContainer_Register_TypeOnce_OneEntryIsRegistered()
 {
     //------------Setup for test--------------------------
     var o = new SimpleObject();
     //------------Execute Test---------------------------
     CustomContainer.Register<ISimpleObject>(o);
     //------------Assert Results-------------------------
     Assert.AreEqual(1, CustomContainer.EntiresCount);
 }
Esempio n. 2
0
 public void CustomContainer_Get_ThereIsATypeRegisted_Type()
 {
     var simpleObject = new SimpleObject();
     CustomContainer.Register<ISimpleObject>(simpleObject);
     //------------Execute Test---------------------------
     var o = CustomContainer.Get<ISimpleObject>();
     //------------Assert Results-------------------------
     Assert.AreEqual(1, CustomContainer.EntiresCount);
     Assert.AreEqual(simpleObject, o);
 }
 public void CustomContainer_Deregister_TypeExists_TypeRemoved()
 {
     //------------Setup for test--------------------------
     var o = new SimpleObject();
     CustomContainer.Register<ISimpleObject>(o);
     var simpleObject = CustomContainer.Get<ISimpleObject>();
     //------------Preconditions--------------------------
     Assert.IsNotNull(simpleObject);
     //------------Execute Test---------------------------
     CustomContainer.DeRegister<ISimpleObject>();
     //------------Assert Results-------------------------
     var objectAfterDeregister = CustomContainer.Get<ISimpleObject>();
     Assert.IsNull(objectAfterDeregister);
 }