Ejemplo n.º 1
0
        public void prop_StatusCode()
        {
            const HttpStatusCode expected = HttpStatusCode.MovedPermanently;
            var actual = new MovedPermanentlyResult("/path").StatusCode;

            Assert.Equal(expected, actual);
        }
        public void prop_StatusCode()
        {
            const HttpStatusCode expected = HttpStatusCode.MovedPermanently;
            var actual = new MovedPermanentlyResult("/path").StatusCode;

            Assert.Equal(expected, actual);
        }
        public void op_SetCache_HttpCachePolicyBase()
        {
            var obj = new MovedPermanentlyResult("/path")
                          {
                              Expires = DateTime.UtcNow.AddMinutes(5)
                          };

            var cache = new Mock<HttpCachePolicyBase>(MockBehavior.Strict);
            cache
                .Setup(x => x.SetCacheability(HttpCacheability.Public))
                .Verifiable();
            cache
                .Setup(x => x.SetExpires(obj.Expires))
                .Verifiable();

            obj.SetCache(cache.Object);

            cache.VerifyAll();
        }
Ejemplo n.º 4
0
        public void op_SetCache_HttpCachePolicyBase()
        {
            var obj = new MovedPermanentlyResult("/path")
            {
                Expires = DateTime.UtcNow.AddMinutes(5)
            };

            var cache = new Mock <HttpCachePolicyBase>(MockBehavior.Strict);

            cache
            .Setup(x => x.SetCacheability(HttpCacheability.Public))
            .Verifiable();
            cache
            .Setup(x => x.SetExpires(obj.Expires))
            .Verifiable();

            obj.SetCache(cache.Object);

            cache.VerifyAll();
        }