public void should_cache_value() { const int value = 6; _data["key"] = value; _data["key"].ShouldEqual(value); _data.Value("key").ShouldEqual(value); _data.Value("key", o => _calledUpon.Action()); _calledUpon.AssertWasCalled(c => c.Action()); _data.Value("non_existing_key").ShouldBeNull(); }
protected override void beforeEach() { theDirectoryResult = new AuthResult(); MockFor <ISamlDirector>().Stub(x => x.Result()).Return(theDirectoryResult); theResponseXml = "<Response />"; theRequestData = new InMemoryRequestData(); theRequestData[SamlAuthenticationStrategy.SamlResponseKey] = theResponseXml; theRequestData.Value(SamlAuthenticationStrategy.SamlResponseKey).ShouldNotBeNull(); Services.Inject <IRequestData>(theRequestData); Services.PartialMockTheClassUnderTest(); ClassUnderTest.Expect(x => x.ProcessSamlResponseXml(theResponseXml)); theResult = ClassUnderTest.TryToApply(); }