public void current_returns_the_current_after_a_register() { theCache.Register("something", "12345"); theCache.Current("something").ShouldEqual("12345"); theCache.Register("something", "23456"); theCache.Current("something").ShouldEqual("23456"); theCache.Register("else", "567"); theCache.Current("else").ShouldEqual("567"); }
public void should_return_stop_and_write_304_response_code_if_the_ifnonematch_header_matches_the_current_etag() { var theResourceHash = Guid.NewGuid().ToString(); theServiceArguments.Get <ICurrentChain>().Stub(x => x.ResourceHash()) .Return(theResourceHash); setRequestIfNoneMatch("12345"); theCache.Register(theResourceHash, "12345"); theFilter.Filter(theServiceArguments).ShouldEqual(DoNext.Stop); theServiceArguments.Get <IHttpWriter>() .AssertWasCalled(x => x.WriteResponseCode(HttpStatusCode.NotModified)); }