示例#1
0
        public void Should_Set_Cacheability()
        {
            // arrange
            var module = new CustomErrorsHelperModule();

            // act
            module.OnError(_httpContext.Object);

            // assert
            _httpCachePolicyBase.Verify(cache => cache.SetCacheability(HttpCacheability.NoCache));
        }
示例#2
0
        public void Should_Set_Http_Status_Code()
        {
            // arrange
            var module = new CustomErrorsHelperModule();

            // act
            module.OnError(_httpContext.Object);

            // assert
            _httpResponse.VerifySet(response => response.StatusCode = (int)_statusCode);
        }
示例#3
0
        public void Should_Add_Content_Type_Header()
        {
            // arrange
            var module = new CustomErrorsHelperModule();

            // act
            module.OnError(_httpContext.Object);

            // assert
            _httpResponse.Verify(response => response.AddHeader("Content-Type", "text/html; charset=utf-8"));
        }