Exemplo n.º 1
0
 public void A_valid_GetAll_does_not_throw()
 {
     using (IoCReset.Create()) {
         IoC.GetAllInstances = type => new object[] { "foo", "bar" };
         Assert.DoesNotThrow(() => IoC.GetAll <string>());
     }
 }
Exemplo n.º 2
0
 public void A_valid_GetInstance_does_not_throw()
 {
     using (IoCReset.Create()) {
         IoC.GetInstance = (type, s) => new object();
         Assert.DoesNotThrow(() => IoC.Get <Object>());
     }
 }
Exemplo n.º 3
0
 public void A_null_GetInstance_throws_a_NullRefrenceException()
 {
     using (IoCReset.Create()) {
         IoC.GetInstance = null;
         Assert.Throws <NullReferenceException>(() => IoC.Get <Object>());
     }
 }
Exemplo n.º 4
0
 public void A_not_initialized_GetInstance_throws_an_InvalidOperationException()
 {
     using (IoCReset.Create())
     {
         Assert.Throws <InvalidOperationException>(() => IoC.Get <object>());
     }
 }
Exemplo n.º 5
0
 public void A_not_initialized_BuildUp_throws_an_InvalidOperationException()
 {
     using (IoCReset.Create())
     {
         Assert.Throws <InvalidOperationException>(() => IoC.BuildUp(new object()));
     }
 }
Exemplo n.º 6
0
 public void A_valid_GetInstance_does_not_throw()
 {
     using (IoCReset.Create())
     {
         IoC.GetInstance = (type, s) => new object();
         IoC.Get <object>();
     }
 }