public void store_and_retrieve_backs_up_by_the_system() { var returnValue = new SomethingThatDoesNotExist(); var context = new TestContext() { BackupResolver = t => { if (t == typeof(ISomethingThatDoesNotExist)) return returnValue; throw new ApplicationException("Unexpected Type: " + t.FullName); } }; context.Retrieve(typeof (ISomethingThatDoesNotExist)).ShouldBeTheSameAs(returnValue); context.Retrieve<ISomethingThatDoesNotExist>().ShouldBeTheSameAs(returnValue); }
public void the_test_is_available_in_the_test_context() { var test = new Test("some test"); var context = new TestContext(new Container(), test, new ConsoleListener()); context.Retrieve<Test>().ShouldBeTheSameAs(test); }
public void store_and_retrieve() { var context = new TestContext(); var data = new SomeContext(); context.Store(data); context.Retrieve<SomeContext>().ShouldBeTheSameAs(data); }