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