Esempio n. 1
0
        public void prop_StatusCode()
        {
            const HttpStatusCode expected = HttpStatusCode.Found;
            var actual = new FoundResult("/path").StatusCode;

            Assert.Equal(expected, actual);
        }
Esempio n. 2
0
        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();
        }
Esempio n. 3
0
        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();
        }
Esempio n. 4
0
        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();
        }
Esempio n. 5
0
        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();
        }
Esempio n. 6
0
        public void prop_StatusCode()
        {
            const HttpStatusCode expected = HttpStatusCode.Found;
            var actual = new FoundResult("/path").StatusCode;

            Assert.Equal(expected, actual);
        }