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