Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

React to aspnet/Razor#485 #3118

Merged
merged 1 commit into from
Sep 11, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@ public async Task CompilationOptions_AreUsedByViewsAndPartials()
#if DNX451
var expected =
@"This method is running from DNX451

This method is only defined in DNX451";
#elif DNXCORE50
var expected =
@"This method is running from DNXCORE50

This method is only defined in DNXCORE50";
#endif
var server = TestHelper.CreateServer(_app, SiteName, _configureServices);
Expand Down
6 changes: 2 additions & 4 deletions test/Microsoft.AspNet.Mvc.FunctionalTests/FlushPointTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ public async Task FlushPointsAreExecutedForPagesWithoutLayouts()

// Assert - 4
Assert.Equal(
@"After flush inside partial
<form action=""/FlushPoint/PageWithoutLayout"" method=""post""><input id=""Name1"" name=""Name1"" type=""text"" value="""" />",
@"After flush inside partial<form action=""/FlushPoint/PageWithoutLayout"" method=""post"">" +
@"<input id=""Name1"" name=""Name1"" type=""text"" value="""" />",
GetTrimmedString(stream),
ignoreLineEndingDifferences: true);
waitService.WaitForServer();
Expand Down Expand Up @@ -107,7 +107,6 @@ public async Task FlushPointsAreExecutedForPagesWithComponentsPartialsAndSection
// Assert - 1
Assert.Equal(
$@"<title>{ title }</title>

RenderBody content",
GetTrimmedString(stream),
ignoreLineEndingDifferences: true);
Expand Down Expand Up @@ -152,7 +151,6 @@ public async Task FlushPointsNestedLayout()
// Assert - 1
Assert.Equal(
@"Inside Nested Layout

<title>Nested Page With Layout</title>",
GetTrimmedString(stream),
ignoreLineEndingDifferences: true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public async Task OverrideAppWideDefaultsInViewAndPartialView()
<div class=""editor-field""><input class=""text-box single-line"" data-val=""true"" data-val-required=""The MyDate field is required."" id=""MyDate"" name=""MyDate"" type=""datetime"" value=""02/01/2000 03:04:05 &#x2B;00:00"" /> <ValidationInView class=""field-validation-valid"" data-valmsg-for=""MyDate"" data-valmsg-replace=""true""></ValidationInView></div>

True

<div class=""validation-summary-errors""><ValidationSummaryInPartialView>MySummary</ValidationSummaryInPartialView>
<ul><li style=""display:none""></li>
</ul></div>
Expand Down
9 changes: 3 additions & 6 deletions test/Microsoft.AspNet.Mvc.FunctionalTests/LocalizationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,15 @@ public static IEnumerable<object[]> LocalizationData
get
{
var expected1 =
@"<language-layout>
en-gb-index
@"<language-layout>en-gb-index
partial
mypartial
</language-layout>";

yield return new[] { "en-GB", expected1 };

var expected2 =
@"<fr-language-layout>
fr-index
@"<fr-language-layout>fr-index
fr-partial
mypartial
</fr-language-layout>";
Expand All @@ -50,8 +48,7 @@ public static IEnumerable<object[]> LocalizationData
{
// https://github.com/aspnet/Mvc/issues/2759
var expected3 =
@"<language-layout>
index
@"<language-layout>index
partial
mypartial
</language-layout>";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public static IEnumerable<object[]> InstrumentationData
{
var expected = @"<div>
2147483647

viewstart-content
<p class=""Hello world"">
page-content
Expand All @@ -32,7 +31,6 @@ public static IEnumerable<object[]> InstrumentationData

var expectedLineMappings = new[]
{
Tuple.Create(90, 1, true),
Tuple.Create(92, 16, false),
Tuple.Create(108, 1, true),
Tuple.Create(0, 2, true),
Expand All @@ -52,30 +50,26 @@ public static IEnumerable<object[]> InstrumentationData

var expected2 = @"<div>
2147483647

viewstart-content
view-with-partial-content

<p class=""class"">partial-content</p>

<p class=""class"">partial-content</p>
</div>";
var expectedLineMappings2 = new[]
{
Tuple.Create(90, 1, true),
Tuple.Create(92, 16, false),
Tuple.Create(108, 1, true),
Tuple.Create(0, 26, true),
Tuple.Create(27, 39, false),
// Html.PartialAsync()
Tuple.Create(27, 3, true),
Tuple.Create(28, 2, true),
Tuple.Create(30, 8, true),
Tuple.Create(38, 4, false),
Tuple.Create(42, 1, true),
Tuple.Create(43, 20, true),
Tuple.Create(66, 1, true),
// Html.RenderPartial()
Tuple.Create(27, 3, true),
Tuple.Create(28, 2, true),
Tuple.Create(30, 8, true),
Tuple.Create(38, 4, false),
Tuple.Create(42, 1, true),
Expand Down Expand Up @@ -179,7 +173,6 @@ public async Task SwitchingFromNonInstrumentedToInstrumentedWorksForLayoutAndVie
// Arrange - 1
var expectedLineMappings = new[]
{
Tuple.Create(90, 1, true),
Tuple.Create(92, 16, false),
Tuple.Create(108, 1, true),
Tuple.Create(0, 2, true),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ _ViewStart that specifies partial Layout
public async Task PartialLayoutPaths_SpecifiedInPage_GetResolvedByViewEngine(string actionName)
{
var expected =
@"<non-shared>
Layout specified in page
@"<non-shared>Layout specified in page
</non-shared>";
var server = TestHelper.CreateServer(_app, SiteName, _configureServices);
var client = server.CreateClient();
Expand All @@ -65,8 +64,7 @@ Layout specified in page
public async Task NonPartialLayoutPaths_GetResolvedByViewEngine(string actionName)
{
var expected =
@"<non-shared>
Page With Non Partial Layout
@"<non-shared>Page With Non Partial Layout
</non-shared>";
var server = TestHelper.CreateServer(_app, SiteName, _configureServices);
var client = server.CreateClient();
Expand All @@ -86,7 +84,6 @@ public async Task PartialsCanBeSpecifiedWithPartialPath(string actionName)
{
var expected =
@"<layout>

Non Shared Partial

</layout>";
Expand Down
12 changes: 0 additions & 12 deletions test/Microsoft.AspNet.Mvc.FunctionalTests/TagHelpersTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,46 +108,34 @@ public static TheoryData TagHelpersAreInheritedFromViewImportsPagesData
{
"ViewWithLayoutAndNestedTagHelper",
@"layout:<root>root-content</root>


<nested>nested-content</nested>"
},
{
"ViewWithInheritedRemoveTagHelper",
@"layout:<root>root-content</root>


page:<root/>
<nested>nested-content</nested>"
},
{
"ViewWithInheritedTagHelperPrefix",
@"layout:<root>root-content</root>


page:<root>root-content</root>"
},
{
"ViewWithOverriddenTagHelperPrefix",
@"layout:<root>root-content</root>



page:<root>root-content</root>"
},
{
"ViewWithNestedInheritedTagHelperPrefix",
@"layout:<root>root-content</root>


page:<root>root-content</root>"
},
{
"ViewWithNestedOverriddenTagHelperPrefix",
@"layout:<root>root-content</root>



page:<root>root-content</root>"
},
};
Expand Down
32 changes: 7 additions & 25 deletions test/Microsoft.AspNet.Mvc.FunctionalTests/ViewEngineTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,22 @@ public static IEnumerable<object[]> RazorView_ExecutesPageAndLayoutData
{
"ViewWithLayout",
@"<layout>

ViewWithLayout-Content
</layout>"
};
yield return new[]
{
"ViewWithFullPath",
@"<layout>

ViewWithFullPath-content
</layout>"
};
yield return new[]
{
"ViewWithNestedLayout",
@"<layout>

<nested-layout>
/ViewEngine/ViewWithNestedLayout

ViewWithNestedLayout-Content
</nested-layout>
</layout>"
Expand Down Expand Up @@ -119,9 +115,7 @@ public async Task RazorView_PassesViewContextBetweenViewAndLayout()
{
var expected =
@"<title>Page title</title>

partial-content
component-content";
partial-contentcomponent-content";
var server = TestHelper.CreateServer(_app, SiteName, _configureServices);
var client = server.CreateClient();

Expand Down Expand Up @@ -212,26 +206,22 @@ public static IEnumerable<object[]> RazorViewEngine_RendersPartialViewsData
{
"PartialViewWithNamePassedIn",
@"<layout>

ViewWithLayout-Content
</layout>"
};
yield return new[]
{
"ViewWithFullPath",
@"<layout>

ViewWithFullPath-content
</layout>"
};
yield return new[]
{
"ViewWithNestedLayout",
@"<layout>

<nested-layout>
/PartialViewEngine/ViewWithNestedLayout

ViewWithNestedLayout-Content
</nested-layout>
</layout>"
Expand Down Expand Up @@ -270,7 +260,6 @@ public async Task LayoutValueIsPassedBetweenNestedViewStarts()
{
// Arrange
var expected = @"<title>viewstart-value</title>

~/Views/NestedViewStarts/NestedViewStarts/Layout.cshtml
index-content";
var server = TestHelper.CreateServer(_app, SiteName, _configureServices);
Expand All @@ -288,8 +277,7 @@ public static IEnumerable<object[]> RazorViewEngine_UsesExpandersForLayoutsData
get
{
var expected1 =
@"<language-layout>
View With Layout
@"<language-layout>View With Layout
</language-layout>";

yield return new[] { "en-GB", expected1 };
Expand All @@ -301,8 +289,7 @@ View With Layout
}

var expected2 =
@"<fr-language-layout>
View With Layout
@"<fr-language-layout>View With Layout
</fr-language-layout>";
yield return new[] { "fr", expected2 };

Expand Down Expand Up @@ -352,11 +339,9 @@ public async Task ViewComponentsExecuteLayout()
// Arrange
var expected =
@"<title>View With Component With Layout</title>

Page Content
<component-title>ViewComponent With Title</component-title>
<component-body>
Component With Layout</component-body>";
<component-body>Component With Layout</component-body>";
var server = TestHelper.CreateServer(_app, SiteName, _configureServices);
var client = server.CreateClient();

Expand Down Expand Up @@ -402,10 +387,8 @@ public async Task PartialsRenderedViaRenderPartialAsync_CanRenderLayouts()
{
// Arrange
var expected =
@"<layout-for-viewstart-with-layout><layout-for-viewstart-with-layout>
Partial that specifies Layout
</layout-for-viewstart-with-layout>Partial that does not specify Layout
</layout-for-viewstart-with-layout>";
@"<layout-for-viewstart-with-layout><layout-for-viewstart-with-layout>Partial that specifies Layout
</layout-for-viewstart-with-layout>Partial that does not specify Layout</layout-for-viewstart-with-layout>";
var server = TestHelper.CreateServer(_app, SiteName, _configureServices);
var client = server.CreateClient();

Expand All @@ -421,8 +404,7 @@ public async Task PartialsRenderedViaPartialAsync_CanRenderLayouts()
{
// Arrange
var expected =
@"<layout-for-viewstart-with-layout><layout-for-viewstart-with-layout>
Partial that specifies Layout
@"<layout-for-viewstart-with-layout><layout-for-viewstart-with-layout>Partial that specifies Layout
</layout-for-viewstart-with-layout>
Partial that does not specify Layout
</layout-for-viewstart-with-layout>";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
</div>
<div>


<div>
<h1>ASP.NET vNext</h1>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@


<span foo=" abc" />
<span bar=" Baz" />
<span baz=" Baz Baz" />
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
</div>
<div>
<label for="HtmlEncode[[Employee_OfficeNumber]]">HtmlEncode[[OfficeNumber]]</label>

<select id="HtmlEncode[[Employee_OfficeNumber]]" name="HtmlEncode[[Employee.OfficeNumber]]"><option>HtmlEncode[[1001]]</option>
<option>HtmlEncode[[1002]]</option>
</select>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
</div>
<div>
<label for="Employee_OfficeNumber">OfficeNumber</label>

<select id="Employee_OfficeNumber" name="Employee.OfficeNumber"><option>1001</option>
<option>1002</option>
</select>
Expand Down
Loading