6 writes to ContentType
Microsoft.AspNetCore.Mvc.Core (1)
ControllerBase.cs (1)
290
ContentType
= contentType?.ToString()
Microsoft.AspNetCore.Mvc.Core.Test (3)
ContentResultTest.cs (3)
30
ContentType
= new MediaTypeHeaderValue("text/plain")
125
ContentType
= contentType?.ToString()
228
ContentType
= contentType
Microsoft.AspNetCore.Mvc.RazorPages (2)
PageBase.cs (1)
257
ContentType
= contentType?.ToString()
PageModel.cs (1)
589
ContentType
= contentType?.ToString()
36 references to ContentType
Microsoft.AspNetCore.Mvc.Core (1)
Infrastructure\ContentResultExecutor.cs (1)
42
result.
ContentType
,
Microsoft.AspNetCore.Mvc.Core.Test (11)
ControllerBaseTest.cs (11)
2191
Assert.Null(actualContentResult.
ContentType
);
2206
Assert.Null(MediaType.GetEncoding(actualContentResult.
ContentType
));
2207
Assert.Equal("text/plain", actualContentResult.
ContentType
.ToString());
2222
Assert.Same(Encoding.UTF8, MediaType.GetEncoding(actualContentResult.
ContentType
));
2223
Assert.Equal("text/plain; charset=utf-8", actualContentResult.
ContentType
.ToString());
2237
Assert.Null(contentResult.
ContentType
);
2251
Assert.NotNull(contentResult.
ContentType
);
2252
Assert.Equal(contentType, contentResult.
ContentType
.ToString());
2254
Assert.Null(MediaType.GetEncoding(contentResult.
ContentType
));
2268
MediaTypeAssert.Equal(contentType, contentResult.
ContentType
);
2282
Assert.Equal(contentType, contentResult.
ContentType
);
Microsoft.AspNetCore.Mvc.RazorPages.Test (22)
PageModelTest.cs (11)
1576
Assert.Null(actualContentResult.
ContentType
);
1591
Assert.Null(MediaType.GetEncoding(actualContentResult.
ContentType
));
1592
Assert.Equal("text/plain", actualContentResult.
ContentType
.ToString());
1607
Assert.Same(Encoding.UTF8, MediaType.GetEncoding(actualContentResult.
ContentType
));
1608
Assert.Equal("text/plain; charset=utf-8", actualContentResult.
ContentType
.ToString());
1622
Assert.Null(contentResult.
ContentType
);
1636
Assert.NotNull(contentResult.
ContentType
);
1637
Assert.Equal(contentType, contentResult.
ContentType
.ToString());
1639
Assert.Null(MediaType.GetEncoding(contentResult.
ContentType
));
1653
MediaTypeAssert.Equal(contentType, contentResult.
ContentType
);
1667
Assert.Equal(contentType, contentResult.
ContentType
);
PageTest.cs (11)
1566
Assert.Null(actualContentResult.
ContentType
);
1581
Assert.Null(MediaType.GetEncoding(actualContentResult.
ContentType
));
1582
Assert.Equal("text/plain", actualContentResult.
ContentType
.ToString());
1597
Assert.Same(Encoding.UTF8, MediaType.GetEncoding(actualContentResult.
ContentType
));
1598
Assert.Equal("text/plain; charset=utf-8", actualContentResult.
ContentType
.ToString());
1612
Assert.Null(contentResult.
ContentType
);
1626
Assert.NotNull(contentResult.
ContentType
);
1627
Assert.Equal(contentType, contentResult.
ContentType
.ToString());
1629
Assert.Null(MediaType.GetEncoding(contentResult.
ContentType
));
1643
MediaTypeAssert.Equal(contentType, contentResult.
ContentType
);
1657
Assert.Equal(contentType, contentResult.
ContentType
);
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (2)
ControllerUnitTestabilityTests.cs (2)
77
Assert.Equal("text/asp; charset=us-ascii", contentResult.
ContentType
.ToString());
78
Assert.Equal(encoding, MediaType.GetEncoding(contentResult.
ContentType
));