コード例 #1
0
        public void Controller_Content_NoContentType_DefaultEncodingIsUsed()
        {
            // Arrange
            var contentController = new ContentController();
            var expected = MediaTypeHeaderValue.Parse("text/plain; charset=utf-8");

            // Act
            var contentResult = (ContentResult)contentController.Content_WithNoEncoding();

            // Assert
            // The default content type of ContentResult is used when the result is executed.
            Assert.Null(contentResult.ContentType);
        }