Add a test for #6294
This case was fixed by 2992f8e - this commit just adds a test to verify
the fix.
This commit is contained in:
parent
2992f8e38a
commit
c1dd95be2a
|
|
@ -1011,6 +1011,19 @@ Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary`1[AspNetCore._InjectedP
|
|||
Assert.StartsWith(expected, response.Trim());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Page_WithSection_CanAccessModel()
|
||||
{
|
||||
// Arrange
|
||||
var expected = "Value is 17";
|
||||
|
||||
// Act
|
||||
var response = await Client.GetStringAsync("/Pages/Section");
|
||||
|
||||
// Assert
|
||||
Assert.StartsWith(expected, response.Trim());
|
||||
}
|
||||
|
||||
private async Task AddAntiforgeryHeaders(HttpRequestMessage request)
|
||||
{
|
||||
var getResponse = await Client.GetAsync(request.RequestUri);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
@page
|
||||
@{
|
||||
Layout = "_Layout";
|
||||
}
|
||||
@functions {
|
||||
public int MyValue { get; set; } = 17;
|
||||
}
|
||||
@section mysection {
|
||||
Value is @Model.MyValue
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
@RenderSection("mysection")
|
||||
Loading…
Reference in New Issue