Example #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));
        }
Example #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);
        }
Example #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"));
        }