public void prop_StatusCode() { const HttpStatusCode expected = HttpStatusCode.Found; var actual = new FoundResult("/path").StatusCode; Assert.Equal(expected, actual); }
public void op_SetCache_HttpCachePolicyBase_whenNoExpires() { var obj = new FoundResult("/path"); var cache = new Mock<HttpCachePolicyBase>(MockBehavior.Strict); cache .Setup(x => x.SetCacheability(HttpCacheability.NoCache)) .Verifiable(); obj.SetCache(cache.Object); cache.VerifyAll(); }
public void op_SetCache_HttpCachePolicyBase_whenNoExpires() { var obj = new FoundResult("/path"); var cache = new Mock <HttpCachePolicyBase>(MockBehavior.Strict); cache .Setup(x => x.SetCacheability(HttpCacheability.NoCache)) .Verifiable(); obj.SetCache(cache.Object); cache.VerifyAll(); }
public void op_SetCache_HttpCachePolicyBase() { var expires = DateTime.UtcNow.AddMinutes(5); var obj = new FoundResult("/path") { Expires = expires }; var cache = new Mock<HttpCachePolicyBase>(); cache .Setup(x => x.SetCacheability(HttpCacheability.Public)) .Verifiable(); cache .Setup(x => x.SetExpires(expires)) .Verifiable(); obj.SetCache(cache.Object); cache.VerifyAll(); }
public void op_SetCache_HttpCachePolicyBase() { var expires = DateTime.UtcNow.AddMinutes(5); var obj = new FoundResult("/path") { Expires = expires }; var cache = new Mock <HttpCachePolicyBase>(); cache .Setup(x => x.SetCacheability(HttpCacheability.Public)) .Verifiable(); cache .Setup(x => x.SetExpires(expires)) .Verifiable(); obj.SetCache(cache.Object); cache.VerifyAll(); }