diff --git a/Mvc.NoFun.sln b/Mvc.NoFun.sln
index 1c9048948d..2497517719 100644
--- a/Mvc.NoFun.sln
+++ b/Mvc.NoFun.sln
@@ -87,6 +87,18 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "MvcSandbox", "samples\MvcSa
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "UrlHelperSample.Web", "samples\UrlHelperSample.Web\UrlHelperSample.Web.xproj", "{73F095D2-D0BD-4D03-BC17-D7A5EF0C0191}"
EndProject
+Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "CustomRouteSample.Web", "samples\CustomRouteSample.Web\CustomRouteSample.Web.xproj", "{364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}"
+EndProject
+Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "EmbeddedViewSample.Web", "samples\EmbeddedViewSample.Web\EmbeddedViewSample.Web.xproj", "{B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}"
+EndProject
+Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "FormatFilterSample.Web", "samples\FormatFilterSample.Web\FormatFilterSample.Web.xproj", "{AC9BE567-540E-4C70-90C2-AAF021307A80}"
+EndProject
+Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "InlineConstraintSample.Web", "samples\InlineConstraintSample.Web\InlineConstraintSample.Web.xproj", "{EA34877F-1AC1-42B7-B4E6-15A093F40CAE}"
+EndProject
+Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "JsonPatchSample.Web", "samples\JsonPatchSample.Web\JsonPatchSample.Web.xproj", "{DAB1252D-577C-4912-98BE-1A812BF83F86}"
+EndProject
+Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "LocalizationSample.Web", "samples\LocalizationSample.Web\LocalizationSample.Web.xproj", "{FCFE6024-2720-49B4-8257-9DBC6114F0F1}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -507,6 +519,78 @@ Global
{73F095D2-D0BD-4D03-BC17-D7A5EF0C0191}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{73F095D2-D0BD-4D03-BC17-D7A5EF0C0191}.Release|x86.ActiveCfg = Release|Any CPU
{73F095D2-D0BD-4D03-BC17-D7A5EF0C0191}.Release|x86.Build.0 = Release|Any CPU
+ {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Debug|x86.Build.0 = Debug|Any CPU
+ {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Release|Any CPU.Build.0 = Release|Any CPU
+ {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Release|x86.ActiveCfg = Release|Any CPU
+ {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Release|x86.Build.0 = Release|Any CPU
+ {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Debug|x86.Build.0 = Debug|Any CPU
+ {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Release|x86.ActiveCfg = Release|Any CPU
+ {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Release|x86.Build.0 = Release|Any CPU
+ {AC9BE567-540E-4C70-90C2-AAF021307A80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {AC9BE567-540E-4C70-90C2-AAF021307A80}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {AC9BE567-540E-4C70-90C2-AAF021307A80}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {AC9BE567-540E-4C70-90C2-AAF021307A80}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {AC9BE567-540E-4C70-90C2-AAF021307A80}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {AC9BE567-540E-4C70-90C2-AAF021307A80}.Debug|x86.Build.0 = Debug|Any CPU
+ {AC9BE567-540E-4C70-90C2-AAF021307A80}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {AC9BE567-540E-4C70-90C2-AAF021307A80}.Release|Any CPU.Build.0 = Release|Any CPU
+ {AC9BE567-540E-4C70-90C2-AAF021307A80}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {AC9BE567-540E-4C70-90C2-AAF021307A80}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {AC9BE567-540E-4C70-90C2-AAF021307A80}.Release|x86.ActiveCfg = Release|Any CPU
+ {AC9BE567-540E-4C70-90C2-AAF021307A80}.Release|x86.Build.0 = Release|Any CPU
+ {EA34877F-1AC1-42B7-B4E6-15A093F40CAE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {EA34877F-1AC1-42B7-B4E6-15A093F40CAE}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {EA34877F-1AC1-42B7-B4E6-15A093F40CAE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {EA34877F-1AC1-42B7-B4E6-15A093F40CAE}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {EA34877F-1AC1-42B7-B4E6-15A093F40CAE}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {EA34877F-1AC1-42B7-B4E6-15A093F40CAE}.Debug|x86.Build.0 = Debug|Any CPU
+ {EA34877F-1AC1-42B7-B4E6-15A093F40CAE}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {EA34877F-1AC1-42B7-B4E6-15A093F40CAE}.Release|Any CPU.Build.0 = Release|Any CPU
+ {EA34877F-1AC1-42B7-B4E6-15A093F40CAE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {EA34877F-1AC1-42B7-B4E6-15A093F40CAE}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {EA34877F-1AC1-42B7-B4E6-15A093F40CAE}.Release|x86.ActiveCfg = Release|Any CPU
+ {EA34877F-1AC1-42B7-B4E6-15A093F40CAE}.Release|x86.Build.0 = Release|Any CPU
+ {DAB1252D-577C-4912-98BE-1A812BF83F86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {DAB1252D-577C-4912-98BE-1A812BF83F86}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {DAB1252D-577C-4912-98BE-1A812BF83F86}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {DAB1252D-577C-4912-98BE-1A812BF83F86}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {DAB1252D-577C-4912-98BE-1A812BF83F86}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {DAB1252D-577C-4912-98BE-1A812BF83F86}.Debug|x86.Build.0 = Debug|Any CPU
+ {DAB1252D-577C-4912-98BE-1A812BF83F86}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {DAB1252D-577C-4912-98BE-1A812BF83F86}.Release|Any CPU.Build.0 = Release|Any CPU
+ {DAB1252D-577C-4912-98BE-1A812BF83F86}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {DAB1252D-577C-4912-98BE-1A812BF83F86}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {DAB1252D-577C-4912-98BE-1A812BF83F86}.Release|x86.ActiveCfg = Release|Any CPU
+ {DAB1252D-577C-4912-98BE-1A812BF83F86}.Release|x86.Build.0 = Release|Any CPU
+ {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Debug|x86.Build.0 = Debug|Any CPU
+ {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Release|Any CPU.Build.0 = Release|Any CPU
+ {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Release|x86.ActiveCfg = Release|Any CPU
+ {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -548,5 +632,11 @@ Global
{9879B5D5-2325-4A81-B4DF-F279FE8FEEB4} = {3BA657BF-28B1-42DA-B5B0-1C4601FCF7B1}
{14ED4476-9F24-4776-8417-EA6927F6C9C9} = {DAAE4C74-D06F-4874-A166-33305D2643CE}
{73F095D2-D0BD-4D03-BC17-D7A5EF0C0191} = {DAAE4C74-D06F-4874-A166-33305D2643CE}
+ {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B} = {DAAE4C74-D06F-4874-A166-33305D2643CE}
+ {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D} = {DAAE4C74-D06F-4874-A166-33305D2643CE}
+ {AC9BE567-540E-4C70-90C2-AAF021307A80} = {DAAE4C74-D06F-4874-A166-33305D2643CE}
+ {EA34877F-1AC1-42B7-B4E6-15A093F40CAE} = {DAAE4C74-D06F-4874-A166-33305D2643CE}
+ {DAB1252D-577C-4912-98BE-1A812BF83F86} = {DAAE4C74-D06F-4874-A166-33305D2643CE}
+ {FCFE6024-2720-49B4-8257-9DBC6114F0F1} = {DAAE4C74-D06F-4874-A166-33305D2643CE}
EndGlobalSection
EndGlobal
diff --git a/Mvc.sln b/Mvc.sln
index 8c0b0b761f..bded2831d8 100644
--- a/Mvc.sln
+++ b/Mvc.sln
@@ -29,10 +29,6 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Mvc.Functi
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "BasicWebSite", "test\WebSites\BasicWebSite\BasicWebSite.xproj", "{34DF1487-12C6-476C-BE0A-F31DF1939AE5}"
EndProject
-Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ActivatorWebSite", "test\WebSites\ActivatorWebSite\ActivatorWebSite.xproj", "{DB79BCBA-9538-4A53-87D9-77728E2BAA39}"
-EndProject
-Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "InlineConstraintsWebSite", "test\WebSites\InlineConstraintsWebSite\InlineConstraintsWebSite.xproj", "{EA34877F-1AC1-42B7-B4E6-15A093F40CAE}"
-EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Mvc.TestConfiguration", "test\WebSites\Microsoft.AspNet.Mvc.TestConfiguration\Microsoft.AspNet.Mvc.TestConfiguration.xproj", "{680D75ED-601F-4D86-B01B-1072D0C31B8C}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "RoutingWebSite", "test\WebSites\RoutingWebSite\RoutingWebSite.xproj", "{42CDBF4A-E238-4C0F-A416-44588363EB4C}"
@@ -43,8 +39,6 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "RazorWebSite", "test\WebSit
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "FormatterWebSite", "test\WebSites\FormatterWebSite\FormatterWebSite.xproj", "{62735776-46FF-4170-9392-02E128A69B89}"
EndProject
-Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ModelBindingWebSite", "test\WebSites\ModelBindingWebSite\ModelBindingWebSite.xproj", "{EE1AB716-F102-4CA3-AD2C-214A44B459A0}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{FAD65E9C-3CF3-4F68-9757-C7358604030B}"
ProjectSection(SolutionItems) = preProject
global.json = global.json
@@ -80,44 +74,28 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Mvc.TagHel
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "PrecompilationWebSite", "test\WebSites\PrecompilationWebSite\PrecompilationWebSite.xproj", "{59E1BE90-92C1-4D35-ADCC-B69F49077C81}"
EndProject
-Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "RazorEmbeddedViewsWebSite", "test\WebSites\RazorEmbeddedViewsWebSite\RazorEmbeddedViewsWebSite.xproj", "{B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}"
-EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "CompositeViewEngineWebSite", "test\WebSites\CompositeViewEngineWebSite\CompositeViewEngineWebSite.xproj", "{A853B2BA-4449-4908-A416-5A3C027FC22B}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "HtmlGenerationWebSite", "test\WebSites\HtmlGenerationWebSite\HtmlGenerationWebSite.xproj", "{920F8A0E-6F7D-4BBE-84FF-840B89099BE6}"
EndProject
-Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ActionResultsWebSite", "test\WebSites\ActionResultsWebSite\ActionResultsWebSite.xproj", "{0A6BB4C0-48D3-4E7F-952B-B8917345E075}"
-EndProject
-Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "LoggingWebSite", "test\WebSites\LoggingWebSite\LoggingWebSite.xproj", "{0AD78AB5-D67C-49BC-81B1-0C51BFA82B5E}"
-EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ErrorPageMiddlewareWebSite", "test\WebSites\ErrorPageMiddlewareWebSite\ErrorPageMiddlewareWebSite.xproj", "{AD545A5B-2BA5-4314-88AC-FC2ACF2CC718}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ActionConstraintsWebSite", "test\WebSites\ActionConstraintsWebSite\ActionConstraintsWebSite.xproj", "{AF210F69-9D31-43AF-AC3A-CD366E252218}"
EndProject
-Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "CustomRouteWebSite", "test\WebSites\CustomRouteWebSite\CustomRouteWebSite.xproj", "{364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}"
-EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "XmlFormattersWebSite", "test\WebSites\XmlFormattersWebSite\XmlFormattersWebSite.xproj", "{C3123A70-41C4-4122-AD1C-D35DF8958DD7}"
EndProject
-Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "FormatFilterWebSite", "test\WebSites\FormatFilterWebSite\FormatFilterWebSite.xproj", "{AC9BE567-540E-4C70-90C2-AAF021307A80}"
-EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ControllersFromServicesWebSite", "test\WebSites\ControllersFromServicesWebSite\ControllersFromServicesWebSite.xproj", "{983741B2-4424-4ED1-9B03-7675A67230C8}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ControllersFromServicesClassLibrary", "test\WebSites\ControllersFromServicesClassLibrary\ControllersFromServicesClassLibrary.xproj", "{551DC89E-2A13-4CF2-83D7-1ADD802443D5}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "UserClassLibrary", "test\WebSites\UserClassLibrary\UserClassLibrary.xproj", "{C651F432-4EBE-41A6-BAD2-3E07CCBA209C}"
EndProject
-Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ControllerDiscoveryConventionsWebSite", "test\WebSites\ControllerDiscoveryConventionsWebSite\ControllerDiscoveryConventionsWebSite.xproj", "{A19022EF-9BA3-4349-94E4-F48E13E1C8AE}"
-EndProject
-Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "LowercaseUrlsWebSite", "test\WebSites\LowercaseUrlsWebSite\LowercaseUrlsWebSite.xproj", "{BCDB13A6-7D6E-485E-8424-A156432B71AC}"
-EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Mvc.TestCommon", "test\Microsoft.AspNet.Mvc.TestCommon\Microsoft.AspNet.Mvc.TestCommon.xproj", "{F504357E-C2E1-4818-BA5C-9A2EAC25FEE5}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "CorsWebSite", "test\WebSites\CorsWebSite\CorsWebSite.xproj", "{94BA134D-04B3-48AA-BA55-5A4DB8640F2D}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "CorsMiddlewareWebSite", "test\WebSites\CorsMiddlewareWebSite\CorsMiddlewareWebSite.xproj", "{B42D4844-FFF8-4EC2-88D1-3AE95234D9EB}"
EndProject
-Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "JsonPatchWebSite", "test\WebSites\JsonPatchWebSite\JsonPatchWebSite.xproj", "{DAB1252D-577C-4912-98BE-1A812BF83F86}"
-EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Mvc.IntegrationTests", "test\Microsoft.AspNet.Mvc.IntegrationTests\Microsoft.AspNet.Mvc.IntegrationTests.xproj", "{864FA09D-1E48-403A-A6C8-4F079D2A30F0}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Mvc.Abstractions", "src\Microsoft.AspNet.Mvc.Abstractions\Microsoft.AspNet.Mvc.Abstractions.xproj", "{1154203C-7579-4525-906E-BC55268421C1}"
@@ -128,8 +106,6 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Mvc.ApiExp
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Mvc.Abstractions.Test", "test\Microsoft.AspNet.Mvc.Abstractions.Test\Microsoft.AspNet.Mvc.Abstractions.Test.xproj", "{DA000953-7532-4DF5-8DB9-8143DF98D999}"
EndProject
-Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "LocalizationWebSite", "test\WebSites\LocalizationWebSite\LocalizationWebSite.xproj", "{FCFE6024-2720-49B4-8257-9DBC6114F0F1}"
-EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "AntiforgeryTokenWebSite", "test\WebSites\AntiforgeryTokenWebSite\AntiforgeryTokenWebSite.xproj", "{A353B17E-A940-4CE8-8BF9-179E24A9041F}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "MvcMinimalSample.Web", "samples\MvcMinimalSample.Web\MvcMinimalSample.Web.xproj", "{F21E225B-190B-4DAA-8B0A-05986D231F56}"
@@ -164,6 +140,18 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "MvcSandbox", "samples\MvcSa
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "UrlHelperSample.Web", "samples\UrlHelperSample.Web\UrlHelperSample.Web.xproj", "{73F095D2-D0BD-4D03-BC17-D7A5EF0C0191}"
EndProject
+Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "CustomRouteSample.Web", "samples\CustomRouteSample.Web\CustomRouteSample.Web.xproj", "{364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}"
+EndProject
+Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "EmbeddedViewSample.Web", "samples\EmbeddedViewSample.Web\EmbeddedViewSample.Web.xproj", "{B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}"
+EndProject
+Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "FormatFilterSample.Web", "samples\FormatFilterSample.Web\FormatFilterSample.Web.xproj", "{AC9BE567-540E-4C70-90C2-AAF021307A80}"
+EndProject
+Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "InlineConstraintSample.Web", "samples\InlineConstraintSample.Web\InlineConstraintSample.Web.xproj", "{EA34877F-1AC1-42B7-B4E6-15A093F40CAE}"
+EndProject
+Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "JsonPatchSample.Web", "samples\JsonPatchSample.Web\JsonPatchSample.Web.xproj", "{DAB1252D-577C-4912-98BE-1A812BF83F86}"
+EndProject
+Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "LocalizationSample.Web", "samples\LocalizationSample.Web\LocalizationSample.Web.xproj", "{FCFE6024-2720-49B4-8257-9DBC6114F0F1}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -264,26 +252,6 @@ Global
{34DF1487-12C6-476C-BE0A-F31DF1939AE5}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{34DF1487-12C6-476C-BE0A-F31DF1939AE5}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{34DF1487-12C6-476C-BE0A-F31DF1939AE5}.Release|x86.ActiveCfg = Release|Any CPU
- {DB79BCBA-9538-4A53-87D9-77728E2BAA39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {DB79BCBA-9538-4A53-87D9-77728E2BAA39}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {DB79BCBA-9538-4A53-87D9-77728E2BAA39}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {DB79BCBA-9538-4A53-87D9-77728E2BAA39}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {DB79BCBA-9538-4A53-87D9-77728E2BAA39}.Debug|x86.ActiveCfg = Debug|Any CPU
- {DB79BCBA-9538-4A53-87D9-77728E2BAA39}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {DB79BCBA-9538-4A53-87D9-77728E2BAA39}.Release|Any CPU.Build.0 = Release|Any CPU
- {DB79BCBA-9538-4A53-87D9-77728E2BAA39}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {DB79BCBA-9538-4A53-87D9-77728E2BAA39}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {DB79BCBA-9538-4A53-87D9-77728E2BAA39}.Release|x86.ActiveCfg = Release|Any CPU
- {EA34877F-1AC1-42B7-B4E6-15A093F40CAE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {EA34877F-1AC1-42B7-B4E6-15A093F40CAE}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {EA34877F-1AC1-42B7-B4E6-15A093F40CAE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {EA34877F-1AC1-42B7-B4E6-15A093F40CAE}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {EA34877F-1AC1-42B7-B4E6-15A093F40CAE}.Debug|x86.ActiveCfg = Debug|Any CPU
- {EA34877F-1AC1-42B7-B4E6-15A093F40CAE}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {EA34877F-1AC1-42B7-B4E6-15A093F40CAE}.Release|Any CPU.Build.0 = Release|Any CPU
- {EA34877F-1AC1-42B7-B4E6-15A093F40CAE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {EA34877F-1AC1-42B7-B4E6-15A093F40CAE}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {EA34877F-1AC1-42B7-B4E6-15A093F40CAE}.Release|x86.ActiveCfg = Release|Any CPU
{680D75ED-601F-4D86-B01B-1072D0C31B8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{680D75ED-601F-4D86-B01B-1072D0C31B8C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{680D75ED-601F-4D86-B01B-1072D0C31B8C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
@@ -334,16 +302,6 @@ Global
{62735776-46FF-4170-9392-02E128A69B89}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{62735776-46FF-4170-9392-02E128A69B89}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{62735776-46FF-4170-9392-02E128A69B89}.Release|x86.ActiveCfg = Release|Any CPU
- {EE1AB716-F102-4CA3-AD2C-214A44B459A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {EE1AB716-F102-4CA3-AD2C-214A44B459A0}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {EE1AB716-F102-4CA3-AD2C-214A44B459A0}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {EE1AB716-F102-4CA3-AD2C-214A44B459A0}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {EE1AB716-F102-4CA3-AD2C-214A44B459A0}.Debug|x86.ActiveCfg = Debug|Any CPU
- {EE1AB716-F102-4CA3-AD2C-214A44B459A0}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {EE1AB716-F102-4CA3-AD2C-214A44B459A0}.Release|Any CPU.Build.0 = Release|Any CPU
- {EE1AB716-F102-4CA3-AD2C-214A44B459A0}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {EE1AB716-F102-4CA3-AD2C-214A44B459A0}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {EE1AB716-F102-4CA3-AD2C-214A44B459A0}.Release|x86.ActiveCfg = Release|Any CPU
{C6E5AFFA-890A-448F-8DE3-878B1D3C9FC7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C6E5AFFA-890A-448F-8DE3-878B1D3C9FC7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C6E5AFFA-890A-448F-8DE3-878B1D3C9FC7}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
@@ -494,18 +452,6 @@ Global
{59E1BE90-92C1-4D35-ADCC-B69F49077C81}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{59E1BE90-92C1-4D35-ADCC-B69F49077C81}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{59E1BE90-92C1-4D35-ADCC-B69F49077C81}.Release|x86.ActiveCfg = Release|Any CPU
- {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Debug|x86.ActiveCfg = Debug|Any CPU
- {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Debug|x86.Build.0 = Debug|Any CPU
- {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Release|Any CPU.Build.0 = Release|Any CPU
- {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Release|x86.ActiveCfg = Release|Any CPU
- {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Release|x86.Build.0 = Release|Any CPU
{A853B2BA-4449-4908-A416-5A3C027FC22B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A853B2BA-4449-4908-A416-5A3C027FC22B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A853B2BA-4449-4908-A416-5A3C027FC22B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
@@ -530,30 +476,6 @@ Global
{920F8A0E-6F7D-4BBE-84FF-840B89099BE6}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{920F8A0E-6F7D-4BBE-84FF-840B89099BE6}.Release|x86.ActiveCfg = Release|Any CPU
{920F8A0E-6F7D-4BBE-84FF-840B89099BE6}.Release|x86.Build.0 = Release|Any CPU
- {0A6BB4C0-48D3-4E7F-952B-B8917345E075}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {0A6BB4C0-48D3-4E7F-952B-B8917345E075}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {0A6BB4C0-48D3-4E7F-952B-B8917345E075}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {0A6BB4C0-48D3-4E7F-952B-B8917345E075}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {0A6BB4C0-48D3-4E7F-952B-B8917345E075}.Debug|x86.ActiveCfg = Debug|Any CPU
- {0A6BB4C0-48D3-4E7F-952B-B8917345E075}.Debug|x86.Build.0 = Debug|Any CPU
- {0A6BB4C0-48D3-4E7F-952B-B8917345E075}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {0A6BB4C0-48D3-4E7F-952B-B8917345E075}.Release|Any CPU.Build.0 = Release|Any CPU
- {0A6BB4C0-48D3-4E7F-952B-B8917345E075}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {0A6BB4C0-48D3-4E7F-952B-B8917345E075}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {0A6BB4C0-48D3-4E7F-952B-B8917345E075}.Release|x86.ActiveCfg = Release|Any CPU
- {0A6BB4C0-48D3-4E7F-952B-B8917345E075}.Release|x86.Build.0 = Release|Any CPU
- {0AD78AB5-D67C-49BC-81B1-0C51BFA82B5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {0AD78AB5-D67C-49BC-81B1-0C51BFA82B5E}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {0AD78AB5-D67C-49BC-81B1-0C51BFA82B5E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {0AD78AB5-D67C-49BC-81B1-0C51BFA82B5E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {0AD78AB5-D67C-49BC-81B1-0C51BFA82B5E}.Debug|x86.ActiveCfg = Debug|Any CPU
- {0AD78AB5-D67C-49BC-81B1-0C51BFA82B5E}.Debug|x86.Build.0 = Debug|Any CPU
- {0AD78AB5-D67C-49BC-81B1-0C51BFA82B5E}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {0AD78AB5-D67C-49BC-81B1-0C51BFA82B5E}.Release|Any CPU.Build.0 = Release|Any CPU
- {0AD78AB5-D67C-49BC-81B1-0C51BFA82B5E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {0AD78AB5-D67C-49BC-81B1-0C51BFA82B5E}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {0AD78AB5-D67C-49BC-81B1-0C51BFA82B5E}.Release|x86.ActiveCfg = Release|Any CPU
- {0AD78AB5-D67C-49BC-81B1-0C51BFA82B5E}.Release|x86.Build.0 = Release|Any CPU
{AD545A5B-2BA5-4314-88AC-FC2ACF2CC718}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AD545A5B-2BA5-4314-88AC-FC2ACF2CC718}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AD545A5B-2BA5-4314-88AC-FC2ACF2CC718}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
@@ -578,18 +500,6 @@ Global
{AF210F69-9D31-43AF-AC3A-CD366E252218}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{AF210F69-9D31-43AF-AC3A-CD366E252218}.Release|x86.ActiveCfg = Release|Any CPU
{AF210F69-9D31-43AF-AC3A-CD366E252218}.Release|x86.Build.0 = Release|Any CPU
- {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Debug|x86.ActiveCfg = Debug|Any CPU
- {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Debug|x86.Build.0 = Debug|Any CPU
- {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Release|Any CPU.Build.0 = Release|Any CPU
- {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Release|x86.ActiveCfg = Release|Any CPU
- {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Release|x86.Build.0 = Release|Any CPU
{C3123A70-41C4-4122-AD1C-D35DF8958DD7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C3123A70-41C4-4122-AD1C-D35DF8958DD7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C3123A70-41C4-4122-AD1C-D35DF8958DD7}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
@@ -602,18 +512,6 @@ Global
{C3123A70-41C4-4122-AD1C-D35DF8958DD7}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{C3123A70-41C4-4122-AD1C-D35DF8958DD7}.Release|x86.ActiveCfg = Release|Any CPU
{C3123A70-41C4-4122-AD1C-D35DF8958DD7}.Release|x86.Build.0 = Release|Any CPU
- {AC9BE567-540E-4C70-90C2-AAF021307A80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {AC9BE567-540E-4C70-90C2-AAF021307A80}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {AC9BE567-540E-4C70-90C2-AAF021307A80}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {AC9BE567-540E-4C70-90C2-AAF021307A80}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {AC9BE567-540E-4C70-90C2-AAF021307A80}.Debug|x86.ActiveCfg = Debug|Any CPU
- {AC9BE567-540E-4C70-90C2-AAF021307A80}.Debug|x86.Build.0 = Debug|Any CPU
- {AC9BE567-540E-4C70-90C2-AAF021307A80}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {AC9BE567-540E-4C70-90C2-AAF021307A80}.Release|Any CPU.Build.0 = Release|Any CPU
- {AC9BE567-540E-4C70-90C2-AAF021307A80}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {AC9BE567-540E-4C70-90C2-AAF021307A80}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {AC9BE567-540E-4C70-90C2-AAF021307A80}.Release|x86.ActiveCfg = Release|Any CPU
- {AC9BE567-540E-4C70-90C2-AAF021307A80}.Release|x86.Build.0 = Release|Any CPU
{983741B2-4424-4ED1-9B03-7675A67230C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{983741B2-4424-4ED1-9B03-7675A67230C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{983741B2-4424-4ED1-9B03-7675A67230C8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
@@ -650,30 +548,6 @@ Global
{C651F432-4EBE-41A6-BAD2-3E07CCBA209C}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{C651F432-4EBE-41A6-BAD2-3E07CCBA209C}.Release|x86.ActiveCfg = Release|Any CPU
{C651F432-4EBE-41A6-BAD2-3E07CCBA209C}.Release|x86.Build.0 = Release|Any CPU
- {A19022EF-9BA3-4349-94E4-F48E13E1C8AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A19022EF-9BA3-4349-94E4-F48E13E1C8AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A19022EF-9BA3-4349-94E4-F48E13E1C8AE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {A19022EF-9BA3-4349-94E4-F48E13E1C8AE}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {A19022EF-9BA3-4349-94E4-F48E13E1C8AE}.Debug|x86.ActiveCfg = Debug|Any CPU
- {A19022EF-9BA3-4349-94E4-F48E13E1C8AE}.Debug|x86.Build.0 = Debug|Any CPU
- {A19022EF-9BA3-4349-94E4-F48E13E1C8AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {A19022EF-9BA3-4349-94E4-F48E13E1C8AE}.Release|Any CPU.Build.0 = Release|Any CPU
- {A19022EF-9BA3-4349-94E4-F48E13E1C8AE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {A19022EF-9BA3-4349-94E4-F48E13E1C8AE}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {A19022EF-9BA3-4349-94E4-F48E13E1C8AE}.Release|x86.ActiveCfg = Release|Any CPU
- {A19022EF-9BA3-4349-94E4-F48E13E1C8AE}.Release|x86.Build.0 = Release|Any CPU
- {BCDB13A6-7D6E-485E-8424-A156432B71AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {BCDB13A6-7D6E-485E-8424-A156432B71AC}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {BCDB13A6-7D6E-485E-8424-A156432B71AC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {BCDB13A6-7D6E-485E-8424-A156432B71AC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {BCDB13A6-7D6E-485E-8424-A156432B71AC}.Debug|x86.ActiveCfg = Debug|Any CPU
- {BCDB13A6-7D6E-485E-8424-A156432B71AC}.Debug|x86.Build.0 = Debug|Any CPU
- {BCDB13A6-7D6E-485E-8424-A156432B71AC}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {BCDB13A6-7D6E-485E-8424-A156432B71AC}.Release|Any CPU.Build.0 = Release|Any CPU
- {BCDB13A6-7D6E-485E-8424-A156432B71AC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {BCDB13A6-7D6E-485E-8424-A156432B71AC}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {BCDB13A6-7D6E-485E-8424-A156432B71AC}.Release|x86.ActiveCfg = Release|Any CPU
- {BCDB13A6-7D6E-485E-8424-A156432B71AC}.Release|x86.Build.0 = Release|Any CPU
{F504357E-C2E1-4818-BA5C-9A2EAC25FEE5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F504357E-C2E1-4818-BA5C-9A2EAC25FEE5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F504357E-C2E1-4818-BA5C-9A2EAC25FEE5}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
@@ -709,18 +583,6 @@ Global
{B42D4844-FFF8-4EC2-88D1-3AE95234D9EB}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{B42D4844-FFF8-4EC2-88D1-3AE95234D9EB}.Release|x86.ActiveCfg = Release|Any CPU
{B42D4844-FFF8-4EC2-88D1-3AE95234D9EB}.Release|x86.Build.0 = Release|Any CPU
- {DAB1252D-577C-4912-98BE-1A812BF83F86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {DAB1252D-577C-4912-98BE-1A812BF83F86}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {DAB1252D-577C-4912-98BE-1A812BF83F86}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {DAB1252D-577C-4912-98BE-1A812BF83F86}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {DAB1252D-577C-4912-98BE-1A812BF83F86}.Debug|x86.ActiveCfg = Debug|Any CPU
- {DAB1252D-577C-4912-98BE-1A812BF83F86}.Debug|x86.Build.0 = Debug|Any CPU
- {DAB1252D-577C-4912-98BE-1A812BF83F86}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {DAB1252D-577C-4912-98BE-1A812BF83F86}.Release|Any CPU.Build.0 = Release|Any CPU
- {DAB1252D-577C-4912-98BE-1A812BF83F86}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {DAB1252D-577C-4912-98BE-1A812BF83F86}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {DAB1252D-577C-4912-98BE-1A812BF83F86}.Release|x86.ActiveCfg = Release|Any CPU
- {DAB1252D-577C-4912-98BE-1A812BF83F86}.Release|x86.Build.0 = Release|Any CPU
{864FA09D-1E48-403A-A6C8-4F079D2A30F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{864FA09D-1E48-403A-A6C8-4F079D2A30F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{864FA09D-1E48-403A-A6C8-4F079D2A30F0}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
@@ -781,18 +643,6 @@ Global
{DA000953-7532-4DF5-8DB9-8143DF98D999}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{DA000953-7532-4DF5-8DB9-8143DF98D999}.Release|x86.ActiveCfg = Release|Any CPU
{DA000953-7532-4DF5-8DB9-8143DF98D999}.Release|x86.Build.0 = Release|Any CPU
- {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Debug|x86.ActiveCfg = Debug|Any CPU
- {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Debug|x86.Build.0 = Debug|Any CPU
- {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Release|Any CPU.Build.0 = Release|Any CPU
- {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Release|x86.ActiveCfg = Release|Any CPU
- {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Release|x86.Build.0 = Release|Any CPU
{A353B17E-A940-4CE8-8BF9-179E24A9041F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A353B17E-A940-4CE8-8BF9-179E24A9041F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A353B17E-A940-4CE8-8BF9-179E24A9041F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
@@ -997,6 +847,78 @@ Global
{73F095D2-D0BD-4D03-BC17-D7A5EF0C0191}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{73F095D2-D0BD-4D03-BC17-D7A5EF0C0191}.Release|x86.ActiveCfg = Release|Any CPU
{73F095D2-D0BD-4D03-BC17-D7A5EF0C0191}.Release|x86.Build.0 = Release|Any CPU
+ {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Debug|x86.Build.0 = Debug|Any CPU
+ {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Release|Any CPU.Build.0 = Release|Any CPU
+ {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Release|x86.ActiveCfg = Release|Any CPU
+ {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B}.Release|x86.Build.0 = Release|Any CPU
+ {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Debug|x86.Build.0 = Debug|Any CPU
+ {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Release|x86.ActiveCfg = Release|Any CPU
+ {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D}.Release|x86.Build.0 = Release|Any CPU
+ {AC9BE567-540E-4C70-90C2-AAF021307A80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {AC9BE567-540E-4C70-90C2-AAF021307A80}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {AC9BE567-540E-4C70-90C2-AAF021307A80}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {AC9BE567-540E-4C70-90C2-AAF021307A80}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {AC9BE567-540E-4C70-90C2-AAF021307A80}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {AC9BE567-540E-4C70-90C2-AAF021307A80}.Debug|x86.Build.0 = Debug|Any CPU
+ {AC9BE567-540E-4C70-90C2-AAF021307A80}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {AC9BE567-540E-4C70-90C2-AAF021307A80}.Release|Any CPU.Build.0 = Release|Any CPU
+ {AC9BE567-540E-4C70-90C2-AAF021307A80}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {AC9BE567-540E-4C70-90C2-AAF021307A80}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {AC9BE567-540E-4C70-90C2-AAF021307A80}.Release|x86.ActiveCfg = Release|Any CPU
+ {AC9BE567-540E-4C70-90C2-AAF021307A80}.Release|x86.Build.0 = Release|Any CPU
+ {EA34877F-1AC1-42B7-B4E6-15A093F40CAE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {EA34877F-1AC1-42B7-B4E6-15A093F40CAE}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {EA34877F-1AC1-42B7-B4E6-15A093F40CAE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {EA34877F-1AC1-42B7-B4E6-15A093F40CAE}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {EA34877F-1AC1-42B7-B4E6-15A093F40CAE}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {EA34877F-1AC1-42B7-B4E6-15A093F40CAE}.Debug|x86.Build.0 = Debug|Any CPU
+ {EA34877F-1AC1-42B7-B4E6-15A093F40CAE}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {EA34877F-1AC1-42B7-B4E6-15A093F40CAE}.Release|Any CPU.Build.0 = Release|Any CPU
+ {EA34877F-1AC1-42B7-B4E6-15A093F40CAE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {EA34877F-1AC1-42B7-B4E6-15A093F40CAE}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {EA34877F-1AC1-42B7-B4E6-15A093F40CAE}.Release|x86.ActiveCfg = Release|Any CPU
+ {EA34877F-1AC1-42B7-B4E6-15A093F40CAE}.Release|x86.Build.0 = Release|Any CPU
+ {DAB1252D-577C-4912-98BE-1A812BF83F86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {DAB1252D-577C-4912-98BE-1A812BF83F86}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {DAB1252D-577C-4912-98BE-1A812BF83F86}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {DAB1252D-577C-4912-98BE-1A812BF83F86}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {DAB1252D-577C-4912-98BE-1A812BF83F86}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {DAB1252D-577C-4912-98BE-1A812BF83F86}.Debug|x86.Build.0 = Debug|Any CPU
+ {DAB1252D-577C-4912-98BE-1A812BF83F86}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {DAB1252D-577C-4912-98BE-1A812BF83F86}.Release|Any CPU.Build.0 = Release|Any CPU
+ {DAB1252D-577C-4912-98BE-1A812BF83F86}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {DAB1252D-577C-4912-98BE-1A812BF83F86}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {DAB1252D-577C-4912-98BE-1A812BF83F86}.Release|x86.ActiveCfg = Release|Any CPU
+ {DAB1252D-577C-4912-98BE-1A812BF83F86}.Release|x86.Build.0 = Release|Any CPU
+ {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Debug|x86.Build.0 = Debug|Any CPU
+ {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Release|Any CPU.Build.0 = Release|Any CPU
+ {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Release|x86.ActiveCfg = Release|Any CPU
+ {FCFE6024-2720-49B4-8257-9DBC6114F0F1}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -1012,14 +934,11 @@ Global
{16703B76-C9F7-4C75-AE6C-53D92E308E3C} = {3BA657BF-28B1-42DA-B5B0-1C4601FCF7B1}
{323D0C04-B518-4A8F-8A8E-3546AD153D34} = {3BA657BF-28B1-42DA-B5B0-1C4601FCF7B1}
{34DF1487-12C6-476C-BE0A-F31DF1939AE5} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
- {DB79BCBA-9538-4A53-87D9-77728E2BAA39} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
- {EA34877F-1AC1-42B7-B4E6-15A093F40CAE} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
{680D75ED-601F-4D86-B01B-1072D0C31B8C} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
{42CDBF4A-E238-4C0F-A416-44588363EB4C} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
{5F945B82-FE5F-425C-956C-8BC2F2020254} = {3BA657BF-28B1-42DA-B5B0-1C4601FCF7B1}
{B07CAF59-11ED-40E3-A5DB-E1178F84FA78} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
{62735776-46FF-4170-9392-02E128A69B89} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
- {EE1AB716-F102-4CA3-AD2C-214A44B459A0} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
{C6E5AFFA-890A-448F-8DE3-878B1D3C9FC7} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
{1976AC4A-FEA4-4587-A158-D9F79736D2B6} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
{61061528-071E-424E-965A-07BCC2F02672} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
@@ -1035,31 +954,22 @@ Global
{B2347320-308E-4D2B-AEC8-005DFA68B0C9} = {32285FA4-6B46-4D6B-A840-2B13E4C8B58E}
{860119ED-3DB1-424D-8D0A-30132A8A7D96} = {3BA657BF-28B1-42DA-B5B0-1C4601FCF7B1}
{59E1BE90-92C1-4D35-ADCC-B69F49077C81} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
- {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
{A853B2BA-4449-4908-A416-5A3C027FC22B} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
{920F8A0E-6F7D-4BBE-84FF-840B89099BE6} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
- {0A6BB4C0-48D3-4E7F-952B-B8917345E075} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
- {0AD78AB5-D67C-49BC-81B1-0C51BFA82B5E} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
{AD545A5B-2BA5-4314-88AC-FC2ACF2CC718} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
{AF210F69-9D31-43AF-AC3A-CD366E252218} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
- {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
{C3123A70-41C4-4122-AD1C-D35DF8958DD7} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
- {AC9BE567-540E-4C70-90C2-AAF021307A80} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
{983741B2-4424-4ED1-9B03-7675A67230C8} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
{551DC89E-2A13-4CF2-83D7-1ADD802443D5} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
{C651F432-4EBE-41A6-BAD2-3E07CCBA209C} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
- {A19022EF-9BA3-4349-94E4-F48E13E1C8AE} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
- {BCDB13A6-7D6E-485E-8424-A156432B71AC} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
{F504357E-C2E1-4818-BA5C-9A2EAC25FEE5} = {3BA657BF-28B1-42DA-B5B0-1C4601FCF7B1}
{94BA134D-04B3-48AA-BA55-5A4DB8640F2D} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
{B42D4844-FFF8-4EC2-88D1-3AE95234D9EB} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
- {DAB1252D-577C-4912-98BE-1A812BF83F86} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
{864FA09D-1E48-403A-A6C8-4F079D2A30F0} = {3BA657BF-28B1-42DA-B5B0-1C4601FCF7B1}
{1154203C-7579-4525-906E-BC55268421C1} = {32285FA4-6B46-4D6B-A840-2B13E4C8B58E}
{A2B72833-5D70-4C42-AE85-E0319926FB8A} = {32285FA4-6B46-4D6B-A840-2B13E4C8B58E}
{4C2AD8AB-8AC0-46C4-80C6-C5577C7255F6} = {3BA657BF-28B1-42DA-B5B0-1C4601FCF7B1}
{DA000953-7532-4DF5-8DB9-8143DF98D999} = {3BA657BF-28B1-42DA-B5B0-1C4601FCF7B1}
- {FCFE6024-2720-49B4-8257-9DBC6114F0F1} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
{A353B17E-A940-4CE8-8BF9-179E24A9041F} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
{F21E225B-190B-4DAA-8B0A-05986D231F56} = {DAAE4C74-D06F-4874-A166-33305D2643CE}
{3F8B8FC1-9FE4-4788-8991-367113E8D7AD} = {32285FA4-6B46-4D6B-A840-2B13E4C8B58E}
@@ -1077,5 +987,11 @@ Global
{9879B5D5-2325-4A81-B4DF-F279FE8FEEB4} = {3BA657BF-28B1-42DA-B5B0-1C4601FCF7B1}
{14ED4476-9F24-4776-8417-EA6927F6C9C9} = {DAAE4C74-D06F-4874-A166-33305D2643CE}
{73F095D2-D0BD-4D03-BC17-D7A5EF0C0191} = {DAAE4C74-D06F-4874-A166-33305D2643CE}
+ {364EC3C6-C9DB-45E0-A0F2-1EE61E4B429B} = {DAAE4C74-D06F-4874-A166-33305D2643CE}
+ {B18ADE62-35DE-4A06-8E1D-EDD6245F7F4D} = {DAAE4C74-D06F-4874-A166-33305D2643CE}
+ {AC9BE567-540E-4C70-90C2-AAF021307A80} = {DAAE4C74-D06F-4874-A166-33305D2643CE}
+ {EA34877F-1AC1-42B7-B4E6-15A093F40CAE} = {DAAE4C74-D06F-4874-A166-33305D2643CE}
+ {DAB1252D-577C-4912-98BE-1A812BF83F86} = {DAAE4C74-D06F-4874-A166-33305D2643CE}
+ {FCFE6024-2720-49B4-8257-9DBC6114F0F1} = {DAAE4C74-D06F-4874-A166-33305D2643CE}
EndGlobalSection
EndGlobal
diff --git a/test/WebSites/CustomRouteWebSite/Controllers/Canada/CustomRoute_ProductsController.cs b/samples/CustomRouteSample.Web/Controllers/Canada/ProductsController.cs
similarity index 74%
rename from test/WebSites/CustomRouteWebSite/Controllers/Canada/CustomRoute_ProductsController.cs
rename to samples/CustomRouteSample.Web/Controllers/Canada/ProductsController.cs
index 1be99c5266..d77dcb5b23 100644
--- a/test/WebSites/CustomRouteWebSite/Controllers/Canada/CustomRoute_ProductsController.cs
+++ b/samples/CustomRouteSample.Web/Controllers/Canada/ProductsController.cs
@@ -3,10 +3,10 @@
using Microsoft.AspNet.Mvc;
-namespace CustomRouteWebSite.Controllers.Canada
+namespace CustomRouteSample.Web.Controllers.Canada
{
[Locale("en-CA")]
- public class CustomRoute_ProductsController : Controller
+ public class ProductsController : Controller
{
public string Index()
{
diff --git a/test/WebSites/CustomRouteWebSite/Controllers/CustomRoute_OrdersControlller.cs b/samples/CustomRouteSample.Web/Controllers/OrdersControlller.cs
similarity index 69%
rename from test/WebSites/CustomRouteWebSite/Controllers/CustomRoute_OrdersControlller.cs
rename to samples/CustomRouteSample.Web/Controllers/OrdersControlller.cs
index c6547b032e..701becaf38 100644
--- a/test/WebSites/CustomRouteWebSite/Controllers/CustomRoute_OrdersControlller.cs
+++ b/samples/CustomRouteSample.Web/Controllers/OrdersControlller.cs
@@ -3,11 +3,11 @@
using Microsoft.AspNet.Mvc;
-namespace CustomRouteWebSite.Controllers
+namespace CustomRouteSample.Web.Controllers
{
- public class CustomRoute_OrdersControlller : Controller
+ public class OrdersControlller : Controller
{
- [HttpGet("CustomRoute_Orders/{id}")]
+ [HttpGet("Orders/{id}")]
public string Index(int id)
{
return "Hello from " + RouteData.Values["locale"] + ".";
diff --git a/test/WebSites/CustomRouteWebSite/Controllers/Spain/CustomRoute_ProductsController.cs b/samples/CustomRouteSample.Web/Controllers/Spain/ProductsController.cs
similarity index 74%
rename from test/WebSites/CustomRouteWebSite/Controllers/Spain/CustomRoute_ProductsController.cs
rename to samples/CustomRouteSample.Web/Controllers/Spain/ProductsController.cs
index 25579993f9..8c0a2a87c5 100644
--- a/test/WebSites/CustomRouteWebSite/Controllers/Spain/CustomRoute_ProductsController.cs
+++ b/samples/CustomRouteSample.Web/Controllers/Spain/ProductsController.cs
@@ -3,10 +3,10 @@
using Microsoft.AspNet.Mvc;
-namespace CustomRouteWebSite.Controllers.Spain
+namespace CustomRouteSample.Web.Controllers.Spain
{
[Locale("es-ES")]
- public class CustomRoute_ProductsController : Controller
+ public class ProductsController : Controller
{
public string Index()
{
diff --git a/test/WebSites/CustomRouteWebSite/Controllers/US/CustomRoute_ProductsController.cs b/samples/CustomRouteSample.Web/Controllers/US/ProductsController.cs
similarity index 75%
rename from test/WebSites/CustomRouteWebSite/Controllers/US/CustomRoute_ProductsController.cs
rename to samples/CustomRouteSample.Web/Controllers/US/ProductsController.cs
index f17a0bf1ec..74e83fa610 100644
--- a/test/WebSites/CustomRouteWebSite/Controllers/US/CustomRoute_ProductsController.cs
+++ b/samples/CustomRouteSample.Web/Controllers/US/ProductsController.cs
@@ -3,10 +3,10 @@
using Microsoft.AspNet.Mvc;
-namespace CustomRouteWebSite.Controllers.US
+namespace CustomRouteSample.Web.Controllers.US
{
[Locale("en-US")]
- public class CustomRoute_ProductsController : Controller
+ public class ProductsController : Controller
{
public string Index()
{
diff --git a/test/WebSites/CustomRouteWebSite/CustomRouteWebSite.xproj b/samples/CustomRouteSample.Web/CustomRouteSample.Web.xproj
similarity index 81%
rename from test/WebSites/CustomRouteWebSite/CustomRouteWebSite.xproj
rename to samples/CustomRouteSample.Web/CustomRouteSample.Web.xproj
index c678df4be0..b18a4a1104 100644
--- a/test/WebSites/CustomRouteWebSite/CustomRouteWebSite.xproj
+++ b/samples/CustomRouteSample.Web/CustomRouteSample.Web.xproj
@@ -7,8 +7,8 @@
364ec3c6-c9db-45e0-a0f2-1ee61e4b429b
- ..\..\..\artifacts\obj\$(MSBuildProjectName)
- ..\..\..\artifacts\bin\$(MSBuildProjectName)\
+ ..\..\artifacts\obj\$(MSBuildProjectName)
+ ..\..\artifacts\bin\$(MSBuildProjectName)\
2.0
diff --git a/test/WebSites/CustomRouteWebSite/LocaleAttribute.cs b/samples/CustomRouteSample.Web/LocaleAttribute.cs
similarity index 92%
rename from test/WebSites/CustomRouteWebSite/LocaleAttribute.cs
rename to samples/CustomRouteSample.Web/LocaleAttribute.cs
index cca23fcc60..f065299660 100644
--- a/test/WebSites/CustomRouteWebSite/LocaleAttribute.cs
+++ b/samples/CustomRouteSample.Web/LocaleAttribute.cs
@@ -3,7 +3,7 @@
using Microsoft.AspNet.Mvc.Infrastructure;
-namespace CustomRouteWebSite
+namespace CustomRouteSample.Web
{
public class LocaleAttribute : RouteConstraintAttribute
{
diff --git a/test/WebSites/CustomRouteWebSite/LocalizedRoute.cs b/samples/CustomRouteSample.Web/LocalizedRoute.cs
similarity index 97%
rename from test/WebSites/CustomRouteWebSite/LocalizedRoute.cs
rename to samples/CustomRouteSample.Web/LocalizedRoute.cs
index a85da8b8aa..992c8f8e09 100644
--- a/test/WebSites/CustomRouteWebSite/LocalizedRoute.cs
+++ b/samples/CustomRouteSample.Web/LocalizedRoute.cs
@@ -7,7 +7,7 @@ using System.Threading.Tasks;
using Microsoft.AspNet.Http;
using Microsoft.AspNet.Routing;
-namespace CustomRouteWebSite
+namespace CustomRouteSample.Web
{
public class LocalizedRoute : IRouter
{
diff --git a/test/WebSites/CustomRouteWebSite/Startup.cs b/samples/CustomRouteSample.Web/Startup.cs
similarity index 91%
rename from test/WebSites/CustomRouteWebSite/Startup.cs
rename to samples/CustomRouteSample.Web/Startup.cs
index 5dbfa766e4..18d1bd16a1 100644
--- a/test/WebSites/CustomRouteWebSite/Startup.cs
+++ b/samples/CustomRouteSample.Web/Startup.cs
@@ -4,7 +4,7 @@
using Microsoft.AspNet.Builder;
using Microsoft.Extensions.DependencyInjection;
-namespace CustomRouteWebSite
+namespace CustomRouteSample.Web
{
public class Startup
{
@@ -16,8 +16,6 @@ namespace CustomRouteWebSite
public void Configure(IApplicationBuilder app)
{
- app.UseCultureReplacer();
-
app.UseMvc(routes =>
{
routes.DefaultHandler = new LocalizedRoute(routes.DefaultHandler);
diff --git a/samples/CustomRouteSample.Web/project.json b/samples/CustomRouteSample.Web/project.json
new file mode 100644
index 0000000000..28e88dae79
--- /dev/null
+++ b/samples/CustomRouteSample.Web/project.json
@@ -0,0 +1,15 @@
+{
+ "commands": {
+ "web": "Microsoft.AspNet.Server.Kestrel",
+ "weblistener": "Microsoft.AspNet.Server.WebListener"
+ },
+ "dependencies": {
+ "Microsoft.AspNet.Mvc": "6.0.0-*",
+ "Microsoft.AspNet.Server.Kestrel": "1.0.0-*",
+ "Microsoft.AspNet.Server.WebListener": "1.0.0-*"
+ },
+ "frameworks": {
+ "dnx451": { },
+ "dnxcore50": { }
+ }
+}
diff --git a/test/WebSites/CustomRouteWebSite/readme.md b/samples/CustomRouteSample.Web/readme.md
similarity index 58%
rename from test/WebSites/CustomRouteWebSite/readme.md
rename to samples/CustomRouteSample.Web/readme.md
index 0547070e1c..857209b1aa 100644
--- a/test/WebSites/CustomRouteWebSite/readme.md
+++ b/samples/CustomRouteSample.Web/readme.md
@@ -1,4 +1,4 @@
-CustomRouteWebSite
+CustomRouteSample.Web
===
-This web site illustrates how a custom route injects route data based on the user.
+This web site illustrates how a custom route injects route data based on a "User" header.
diff --git a/samples/CustomRouteSample.Web/wwwroot/web.config b/samples/CustomRouteSample.Web/wwwroot/web.config
new file mode 100644
index 0000000000..8485f6719f
--- /dev/null
+++ b/samples/CustomRouteSample.Web/wwwroot/web.config
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/test/WebSites/RazorEmbeddedViewsWebSite/Controllers/RazorEmbeddedViews_AdminController.cs b/samples/EmbeddedViewSample.Web/Controllers/AdminController.cs
similarity index 73%
rename from test/WebSites/RazorEmbeddedViewsWebSite/Controllers/RazorEmbeddedViews_AdminController.cs
rename to samples/EmbeddedViewSample.Web/Controllers/AdminController.cs
index 363dd9b705..4c78b0c0c7 100644
--- a/test/WebSites/RazorEmbeddedViewsWebSite/Controllers/RazorEmbeddedViews_AdminController.cs
+++ b/samples/EmbeddedViewSample.Web/Controllers/AdminController.cs
@@ -3,10 +3,10 @@
using Microsoft.AspNet.Mvc;
-namespace RazorEmbeddedViewsWebSite.Controllers
+namespace EmbeddedViewSample.Web.Controllers
{
[Area("Restricted")]
- public class RazorEmbeddedViews_AdminController : Controller
+ public class AdminController : Controller
{
public IActionResult Login()
{
diff --git a/test/WebSites/LoggingWebSite/Controllers/HomeController.cs b/samples/EmbeddedViewSample.Web/Controllers/HomeController.cs
similarity index 67%
rename from test/WebSites/LoggingWebSite/Controllers/HomeController.cs
rename to samples/EmbeddedViewSample.Web/Controllers/HomeController.cs
index 787cd7892d..ba08130083 100644
--- a/test/WebSites/LoggingWebSite/Controllers/HomeController.cs
+++ b/samples/EmbeddedViewSample.Web/Controllers/HomeController.cs
@@ -3,13 +3,19 @@
using Microsoft.AspNet.Mvc;
-namespace LoggingWebSite.Controllers
+namespace EmbeddedViewSample.Web
{
public class HomeController : Controller
{
+ // Interactive home page.
public IActionResult Index()
{
return View();
}
+
+ public IActionResult EchoActionUrl()
+ {
+ return View();
+ }
}
}
\ No newline at end of file
diff --git a/test/WebSites/RazorEmbeddedViewsWebSite/EmbeddedResources/Areas/Restricted/Views/RazorEmbeddedViews_Admin/Login.cshtml b/samples/EmbeddedViewSample.Web/EmbeddedResources/Areas/Restricted/Views/Admin/Login.cshtml
similarity index 100%
rename from test/WebSites/RazorEmbeddedViewsWebSite/EmbeddedResources/Areas/Restricted/Views/RazorEmbeddedViews_Admin/Login.cshtml
rename to samples/EmbeddedViewSample.Web/EmbeddedResources/Areas/Restricted/Views/Admin/Login.cshtml
diff --git a/test/WebSites/RazorEmbeddedViewsWebSite/EmbeddedResources/Views/RazorEmbeddedViews_Home/Index.cshtml b/samples/EmbeddedViewSample.Web/EmbeddedResources/Views/Home/EchoActionUrl.cshtml
similarity index 100%
rename from test/WebSites/RazorEmbeddedViewsWebSite/EmbeddedResources/Views/RazorEmbeddedViews_Home/Index.cshtml
rename to samples/EmbeddedViewSample.Web/EmbeddedResources/Views/Home/EchoActionUrl.cshtml
diff --git a/samples/EmbeddedViewSample.Web/EmbeddedResources/Views/Home/Index.cshtml b/samples/EmbeddedViewSample.Web/EmbeddedResources/Views/Home/Index.cshtml
new file mode 100644
index 0000000000..facd4356e0
--- /dev/null
+++ b/samples/EmbeddedViewSample.Web/EmbeddedResources/Views/Home/Index.cshtml
@@ -0,0 +1,13 @@
+
+ Home page
+
+
+ - @Html.ActionLink(
+ linkText: "Administrator login",
+ actionName: "Login",
+ controllerName: "Admin",
+ routeValues: new { area = "Restricted" })
+ - @Html.ActionLink(linkText: "Echo action", actionName: "EchoActionUrl")
+
+
+
\ No newline at end of file
diff --git a/test/WebSites/RazorEmbeddedViewsWebSite/RazorEmbeddedViewsWebSite.xproj b/samples/EmbeddedViewSample.Web/EmbeddedViewSample.Web.xproj
similarity index 81%
rename from test/WebSites/RazorEmbeddedViewsWebSite/RazorEmbeddedViewsWebSite.xproj
rename to samples/EmbeddedViewSample.Web/EmbeddedViewSample.Web.xproj
index 66f61f5f01..e90d83da64 100644
--- a/test/WebSites/RazorEmbeddedViewsWebSite/RazorEmbeddedViewsWebSite.xproj
+++ b/samples/EmbeddedViewSample.Web/EmbeddedViewSample.Web.xproj
@@ -7,8 +7,8 @@
b18ade62-35de-4a06-8e1d-edd6245f7f4d
- ..\..\..\artifacts\obj\$(MSBuildProjectName)
- ..\..\..\artifacts\bin\$(MSBuildProjectName)\
+ ..\..\artifacts\obj\$(MSBuildProjectName)
+ ..\..\artifacts\bin\$(MSBuildProjectName)\
2.0
diff --git a/test/WebSites/RazorEmbeddedViewsWebSite/Startup.cs b/samples/EmbeddedViewSample.Web/Startup.cs
similarity index 68%
rename from test/WebSites/RazorEmbeddedViewsWebSite/Startup.cs
rename to samples/EmbeddedViewSample.Web/Startup.cs
index cb2174f57e..9f67212257 100644
--- a/test/WebSites/RazorEmbeddedViewsWebSite/Startup.cs
+++ b/samples/EmbeddedViewSample.Web/Startup.cs
@@ -7,7 +7,7 @@ using Microsoft.AspNet.FileProviders;
using Microsoft.AspNet.Mvc.Razor;
using Microsoft.Extensions.DependencyInjection;
-namespace RazorEmbeddedViewsWebSite
+namespace EmbeddedViewSample.Web
{
public class Startup
{
@@ -19,20 +19,22 @@ namespace RazorEmbeddedViewsWebSite
services.Configure(options =>
{
- options.FileProvider = new EmbeddedFileProvider(GetType().GetTypeInfo().Assembly, "RazorEmbeddedViewsWebSite.EmbeddedResources");
+ // Base namespace matches the resources added to the assembly from the EmbeddedResources folder.
+ options.FileProvider = new EmbeddedFileProvider(
+ GetType().GetTypeInfo().Assembly,
+ baseNamespace: "EmbeddedViewSample.Web.EmbeddedResources");
});
}
public void Configure(IApplicationBuilder app)
{
- app.UseCultureReplacer();
-
app.UseMvc(routes =>
{
routes.MapRoute("areaRoute", "{area:exists}/{controller}/{action}");
- routes.MapRoute("default",
- "{controller}/{action}/{id?}",
- new { controller = "Home", action = "Index" });
+ routes.MapRoute(
+ "default",
+ "{controller}/{action}/{id?}",
+ new { controller = "Home", action = "Index" });
});
}
}
diff --git a/samples/EmbeddedViewSample.Web/project.json b/samples/EmbeddedViewSample.Web/project.json
new file mode 100644
index 0000000000..51d75a82c1
--- /dev/null
+++ b/samples/EmbeddedViewSample.Web/project.json
@@ -0,0 +1,17 @@
+{
+ "commands": {
+ "web": "Microsoft.AspNet.Server.Kestrel",
+ "weblistener": "Microsoft.AspNet.Server.WebListener"
+ },
+ "resource": "EmbeddedResources/**",
+ "dependencies": {
+ "Microsoft.AspNet.FileProviders.Embedded": "1.0.0-*",
+ "Microsoft.AspNet.Mvc": "6.0.0-*",
+ "Microsoft.AspNet.Server.Kestrel": "1.0.0-*",
+ "Microsoft.AspNet.Server.WebListener": "1.0.0-*"
+ },
+ "frameworks": {
+ "dnx451": { },
+ "dnxcore50": { }
+ }
+}
diff --git a/test/WebSites/RazorEmbeddedViewsWebSite/readme.md b/samples/EmbeddedViewSample.Web/readme.md
similarity index 76%
rename from test/WebSites/RazorEmbeddedViewsWebSite/readme.md
rename to samples/EmbeddedViewSample.Web/readme.md
index d4e97aff00..49ec6495da 100644
--- a/test/WebSites/RazorEmbeddedViewsWebSite/readme.md
+++ b/samples/EmbeddedViewSample.Web/readme.md
@@ -1,4 +1,4 @@
-RazorEmbeddedViewsWebSite
+EmbeddedViewSample.Web
===
This web site illustrates use cases for `RazorViewEngineOptions.FileProvider`.
diff --git a/samples/EmbeddedViewSample.Web/wwwroot/web.config b/samples/EmbeddedViewSample.Web/wwwroot/web.config
new file mode 100644
index 0000000000..8485f6719f
--- /dev/null
+++ b/samples/EmbeddedViewSample.Web/wwwroot/web.config
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/test/WebSites/FormatFilterWebSite/Controllers/FormatFilterController.cs b/samples/FormatFilterSample.Web/Controllers/FormatFilterController.cs
similarity index 74%
rename from test/WebSites/FormatFilterWebSite/Controllers/FormatFilterController.cs
rename to samples/FormatFilterSample.Web/Controllers/FormatFilterController.cs
index e1c46443ab..2c9a01bb26 100644
--- a/test/WebSites/FormatFilterWebSite/Controllers/FormatFilterController.cs
+++ b/samples/FormatFilterSample.Web/Controllers/FormatFilterController.cs
@@ -3,17 +3,20 @@
using Microsoft.AspNet.Mvc;
-namespace FormatFilterWebSite
+namespace FormatFilterSample.Web
{
[FormatFilter]
public class FormatFilterController : Controller
- {
+ {
+ [Route("[controller]/[action]/{id}.{format?}")]
+ [Route("[controller]/[action].{format}")]
public Product GetProduct(int id = 0)
{
return new Product() { SampleInt = id };
}
[Produces("application/custom", "application/json", "text/json")]
+ [Route("[controller]/[action]/{id}.{format}")]
public Product ProducesMethod(int id)
{
return new Product() { SampleInt = id };
diff --git a/test/WebSites/FormatFilterWebSite/Controllers/ProducesOverrideClass.cs b/samples/FormatFilterSample.Web/Controllers/ProducesOverrideClass.cs
similarity index 69%
rename from test/WebSites/FormatFilterWebSite/Controllers/ProducesOverrideClass.cs
rename to samples/FormatFilterSample.Web/Controllers/ProducesOverrideClass.cs
index f1d397abe3..c592c99cce 100644
--- a/test/WebSites/FormatFilterWebSite/Controllers/ProducesOverrideClass.cs
+++ b/samples/FormatFilterSample.Web/Controllers/ProducesOverrideClass.cs
@@ -3,15 +3,16 @@
using Microsoft.AspNet.Mvc;
-namespace FormatFilterWebSite
+namespace FormatFilterSample.Web
{
- [Produces("application/custom_ProducesController")]
+ [Produces("application/controller")]
+ [Route("[controller]/[action]")]
public class ProducesOverrideController
{
- [Produces("application/ProducesMethod")]
+ [Produces("application/custom")]
public string ReturnClassName()
{
return "ProducesOverrideController";
}
- }
+ }
}
\ No newline at end of file
diff --git a/test/WebSites/FormatFilterWebSite/CustomFormatter.cs b/samples/FormatFilterSample.Web/CustomFormatter.cs
similarity index 78%
rename from test/WebSites/FormatFilterWebSite/CustomFormatter.cs
rename to samples/FormatFilterSample.Web/CustomFormatter.cs
index 57708c6be1..ed915cb37c 100644
--- a/test/WebSites/FormatFilterWebSite/CustomFormatter.cs
+++ b/samples/FormatFilterSample.Web/CustomFormatter.cs
@@ -7,12 +7,10 @@ using Microsoft.AspNet.Http;
using Microsoft.AspNet.Mvc.Formatters;
using Microsoft.Net.Http.Headers;
-namespace FormatFilterWebSite
+namespace FormatFilterSample.Web
{
public class CustomFormatter : OutputFormatter
{
- public string ContentType { get; private set; }
-
public CustomFormatter(string contentType)
{
ContentType = contentType;
@@ -20,22 +18,29 @@ namespace FormatFilterWebSite
SupportedEncodings.Add(Encoding.GetEncoding("utf-8"));
}
+ public string ContentType { get; }
+
public override bool CanWriteResult(OutputFormatterCanWriteContext context)
{
if (base.CanWriteResult(context))
{
- var actionReturn = context.Object as Product;
- if (actionReturn != null)
+ if (context.Object is Product)
+ {
+ return true;
+ }
+
+ if (context.Object is string)
{
return true;
}
}
+
return false;
}
public override async Task WriteResponseBodyAsync(OutputFormatterWriteContext context)
{
- var response = context.HttpContext.Response;
+ var response = context.HttpContext.Response;
await response.WriteAsync(context.Object.ToString());
}
}
diff --git a/test/WebSites/FormatFilterWebSite/FormatFilterWebSite.xproj b/samples/FormatFilterSample.Web/FormatFilterSample.Web.xproj
similarity index 81%
rename from test/WebSites/FormatFilterWebSite/FormatFilterWebSite.xproj
rename to samples/FormatFilterSample.Web/FormatFilterSample.Web.xproj
index 2fa473d108..150dd615c6 100644
--- a/test/WebSites/FormatFilterWebSite/FormatFilterWebSite.xproj
+++ b/samples/FormatFilterSample.Web/FormatFilterSample.Web.xproj
@@ -7,8 +7,8 @@
ac9be567-540e-4c70-90c2-aaf021307a80
- ..\..\..\artifacts\obj\$(MSBuildProjectName)
- ..\..\..\artifacts\bin\$(MSBuildProjectName)\
+ ..\..\artifacts\obj\$(MSBuildProjectName)
+ ..\..\artifacts\bin\$(MSBuildProjectName)\
2.0
diff --git a/samples/FormatFilterSample.Web/Models/Product.cs b/samples/FormatFilterSample.Web/Models/Product.cs
new file mode 100644
index 0000000000..034e8ea58d
--- /dev/null
+++ b/samples/FormatFilterSample.Web/Models/Product.cs
@@ -0,0 +1,15 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+namespace FormatFilterSample.Web
+{
+ public class Product
+ {
+ public int SampleInt { get; set; }
+
+ public override string ToString()
+ {
+ return "SampleInt:" + SampleInt;
+ }
+ }
+}
\ No newline at end of file
diff --git a/test/WebSites/FormatFilterWebSite/Startup.cs b/samples/FormatFilterSample.Web/Startup.cs
similarity index 64%
rename from test/WebSites/FormatFilterWebSite/Startup.cs
rename to samples/FormatFilterSample.Web/Startup.cs
index f7193d6e8c..3699d7293c 100644
--- a/test/WebSites/FormatFilterWebSite/Startup.cs
+++ b/samples/FormatFilterSample.Web/Startup.cs
@@ -3,11 +3,11 @@
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Mvc;
-using Microsoft.AspNet.Routing;
+using Microsoft.AspNet.Mvc.Formatters;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Net.Http.Headers;
-namespace FormatFilterWebSite
+namespace FormatFilterSample.Web
{
public class Startup
{
@@ -21,6 +21,7 @@ namespace FormatFilterWebSite
var customFormatter = new CustomFormatter("application/custom");
options.OutputFormatters.Add(customFormatter);
+ options.OutputFormatters.RemoveType();
options.FormatterMappings.SetMediaTypeMappingForFormat(
"custom",
@@ -30,18 +31,7 @@ namespace FormatFilterWebSite
public void Configure(IApplicationBuilder app)
{
- app.UseCultureReplacer();
-
- app.UseMvc(routes =>
- {
- routes.MapRoute("formatroute",
- "{controller}/{action}/{id}.{format?}",
- new { controller = "Home", action = "Index" });
-
- routes.MapRoute("optionalroute",
- "{controller}/{action}.{format?}",
- new { controller = "Home", action = "Index" });
- });
+ app.UseMvc();
}
}
}
\ No newline at end of file
diff --git a/samples/FormatFilterSample.Web/project.json b/samples/FormatFilterSample.Web/project.json
new file mode 100644
index 0000000000..28e88dae79
--- /dev/null
+++ b/samples/FormatFilterSample.Web/project.json
@@ -0,0 +1,15 @@
+{
+ "commands": {
+ "web": "Microsoft.AspNet.Server.Kestrel",
+ "weblistener": "Microsoft.AspNet.Server.WebListener"
+ },
+ "dependencies": {
+ "Microsoft.AspNet.Mvc": "6.0.0-*",
+ "Microsoft.AspNet.Server.Kestrel": "1.0.0-*",
+ "Microsoft.AspNet.Server.WebListener": "1.0.0-*"
+ },
+ "frameworks": {
+ "dnx451": { },
+ "dnxcore50": { }
+ }
+}
diff --git a/samples/FormatFilterSample.Web/readme.md b/samples/FormatFilterSample.Web/readme.md
new file mode 100644
index 0000000000..4aaf176a2a
--- /dev/null
+++ b/samples/FormatFilterSample.Web/readme.md
@@ -0,0 +1,5 @@
+FormatFilterSample.Web
+===
+
+This web site illustrates in depth the process of using new feature URL Media header mappings. It demonstrates adding
+URL formats and content type mappings and using them. It also shows how routes need to change for this feature to work.
diff --git a/samples/FormatFilterSample.Web/wwwroot/web.config b/samples/FormatFilterSample.Web/wwwroot/web.config
new file mode 100644
index 0000000000..8485f6719f
--- /dev/null
+++ b/samples/FormatFilterSample.Web/wwwroot/web.config
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/test/WebSites/InlineConstraintsWebSite/Constraints/IsbnDigitScheme10Constraint.cs b/samples/InlineConstraintSample.Web/Constraints/IsbnDigitScheme10Constraint.cs
similarity index 97%
rename from test/WebSites/InlineConstraintsWebSite/Constraints/IsbnDigitScheme10Constraint.cs
rename to samples/InlineConstraintSample.Web/Constraints/IsbnDigitScheme10Constraint.cs
index cb8474e615..33a2a80633 100644
--- a/test/WebSites/InlineConstraintsWebSite/Constraints/IsbnDigitScheme10Constraint.cs
+++ b/samples/InlineConstraintSample.Web/Constraints/IsbnDigitScheme10Constraint.cs
@@ -4,11 +4,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Text.RegularExpressions;
using Microsoft.AspNet.Http;
using Microsoft.AspNet.Routing;
-namespace InlineConstraintsWebSite.Constraints
+namespace InlineConstraintSample.Web.Constraints
{
public class IsbnDigitScheme10Constraint : IRouteConstraint
{
diff --git a/test/WebSites/InlineConstraintsWebSite/Constraints/IsbnDigitScheme13Constraint.cs b/samples/InlineConstraintSample.Web/Constraints/IsbnDigitScheme13Constraint.cs
similarity index 96%
rename from test/WebSites/InlineConstraintsWebSite/Constraints/IsbnDigitScheme13Constraint.cs
rename to samples/InlineConstraintSample.Web/Constraints/IsbnDigitScheme13Constraint.cs
index 7242770f60..b9761742d7 100644
--- a/test/WebSites/InlineConstraintsWebSite/Constraints/IsbnDigitScheme13Constraint.cs
+++ b/samples/InlineConstraintSample.Web/Constraints/IsbnDigitScheme13Constraint.cs
@@ -7,7 +7,7 @@ using System.Linq;
using Microsoft.AspNet.Http;
using Microsoft.AspNet.Routing;
-namespace InlineConstraintsWebSite.Constraints
+namespace InlineConstraintSample.Web.Constraints
{
public class IsbnDigitScheme13Constraint : IRouteConstraint
{
diff --git a/test/WebSites/InlineConstraintsWebSite/Controllers/HomeController.cs b/samples/InlineConstraintSample.Web/Controllers/HomeController.cs
similarity index 70%
rename from test/WebSites/InlineConstraintsWebSite/Controllers/HomeController.cs
rename to samples/InlineConstraintSample.Web/Controllers/HomeController.cs
index 36520666cf..0f7b332da2 100644
--- a/test/WebSites/InlineConstraintsWebSite/Controllers/HomeController.cs
+++ b/samples/InlineConstraintSample.Web/Controllers/HomeController.cs
@@ -3,10 +3,13 @@
using Microsoft.AspNet.Mvc;
-namespace InlineConstraints.Controllers
+namespace InlineConstraintSample.Web.Controllers
{
public class HomeController : Controller
{
+ [Route("")]
+ [Route("[controller]")]
+ [Route("[controller]/[action]")]
public IActionResult Index()
{
return View();
diff --git a/samples/InlineConstraintSample.Web/Controllers/Isbn10Controller.cs b/samples/InlineConstraintSample.Web/Controllers/Isbn10Controller.cs
new file mode 100644
index 0000000000..c83f7a87a1
--- /dev/null
+++ b/samples/InlineConstraintSample.Web/Controllers/Isbn10Controller.cs
@@ -0,0 +1,16 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using Microsoft.AspNet.Mvc;
+
+namespace InlineConstraintSample.Web.Controllers
+{
+ public class Isbn10Controller : Controller
+ {
+ [Route("book/[action]/{isbnNumber:IsbnDigitScheme10(true)}")]
+ public string Index(string isbnNumber)
+ {
+ return "10 Digit ISBN Number " + isbnNumber;
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/InlineConstraintSample.Web/Controllers/Isbn13Controller.cs b/samples/InlineConstraintSample.Web/Controllers/Isbn13Controller.cs
new file mode 100644
index 0000000000..ff3fb87602
--- /dev/null
+++ b/samples/InlineConstraintSample.Web/Controllers/Isbn13Controller.cs
@@ -0,0 +1,17 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using Microsoft.AspNet.Mvc;
+
+namespace InlineConstraintSample.Web.Controllers
+{
+ [Route("book/[action]")]
+ public class Isbn13Controller : Controller
+ {
+ [HttpGet("{isbnNumber:IsbnDigitScheme13}")]
+ public string Index(string isbnNumber)
+ {
+ return "13 Digit ISBN Number " + isbnNumber;
+ }
+ }
+}
\ No newline at end of file
diff --git a/test/WebSites/InlineConstraintsWebSite/Controllers/ProductsController.cs b/samples/InlineConstraintSample.Web/Controllers/ProductsController.cs
similarity index 94%
rename from test/WebSites/InlineConstraintsWebSite/Controllers/ProductsController.cs
rename to samples/InlineConstraintSample.Web/Controllers/ProductsController.cs
index 0d0135eafe..26aaca719b 100644
--- a/test/WebSites/InlineConstraintsWebSite/Controllers/ProductsController.cs
+++ b/samples/InlineConstraintSample.Web/Controllers/ProductsController.cs
@@ -1,15 +1,15 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-using Microsoft.AspNet.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
+using Microsoft.AspNet.Mvc;
-namespace InlineConstraintsWebSite.Controllers
+namespace InlineConstraintSample.Web.Controllers
{
[Route("products/[action]")]
- public class InlineConstraints_ProductsController : Controller
+ public class ProductsController : Controller
{
public IDictionary Index()
{
@@ -51,7 +51,7 @@ namespace InlineConstraintsWebSite.Controllers
{
return RouteData.Values;
}
-
+
[HttpGet("{manId:int:min(10)?}")]
public IDictionary GetProductByManufacturerId(int manId)
{
diff --git a/test/WebSites/InlineConstraintsWebSite/Controllers/StoreController.cs b/samples/InlineConstraintSample.Web/Controllers/StoreController.cs
similarity index 70%
rename from test/WebSites/InlineConstraintsWebSite/Controllers/StoreController.cs
rename to samples/InlineConstraintSample.Web/Controllers/StoreController.cs
index c3b2accff7..c64e5352c1 100644
--- a/test/WebSites/InlineConstraintsWebSite/Controllers/StoreController.cs
+++ b/samples/InlineConstraintSample.Web/Controllers/StoreController.cs
@@ -1,19 +1,21 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-using Microsoft.AspNet.Mvc;
using System;
using System.Collections.Generic;
+using Microsoft.AspNet.Mvc;
-namespace InlineConstraintsWebSite.Controllers
+namespace InlineConstraintSample.Web.Controllers
{
- public class InlineConstraints_StoreController : Controller
+ public class StoreController : Controller
{
+ [Route("store/[action]/{id:guid?}")]
public IDictionary GetStoreById(Guid id)
{
return RouteData.Values;
}
+ [Route("store/[action]/{location:alpha:minlength(3):maxlength(10)}")]
public IDictionary GetStoreByLocation(string location)
{
return RouteData.Values;
diff --git a/test/WebSites/InlineConstraintsWebSite/Controllers/UsersController.cs b/samples/InlineConstraintSample.Web/Controllers/UsersController.cs
similarity index 78%
rename from test/WebSites/InlineConstraintsWebSite/Controllers/UsersController.cs
rename to samples/InlineConstraintSample.Web/Controllers/UsersController.cs
index e8eb03246e..89d2131ed8 100644
--- a/test/WebSites/InlineConstraintsWebSite/Controllers/UsersController.cs
+++ b/samples/InlineConstraintSample.Web/Controllers/UsersController.cs
@@ -3,10 +3,11 @@
using Microsoft.AspNet.Mvc;
-namespace InlineConstraints.Controllers
+namespace InlineConstraintSample.Web.Controllers
{
public class UsersController : Controller
{
+ [Route("constant-prefix/[controller]")]
public IActionResult Index()
{
return Content("Users.Index");
diff --git a/test/WebSites/InlineConstraintsWebSite/InlineConstraintsWebSite.xproj b/samples/InlineConstraintSample.Web/InlineConstraintSample.Web.xproj
similarity index 81%
rename from test/WebSites/InlineConstraintsWebSite/InlineConstraintsWebSite.xproj
rename to samples/InlineConstraintSample.Web/InlineConstraintSample.Web.xproj
index 0f547aabf7..9890884355 100644
--- a/test/WebSites/InlineConstraintsWebSite/InlineConstraintsWebSite.xproj
+++ b/samples/InlineConstraintSample.Web/InlineConstraintSample.Web.xproj
@@ -7,8 +7,8 @@
ea34877f-1ac1-42b7-b4e6-15a093f40cae
- ..\..\..\artifacts\obj\$(MSBuildProjectName)
- ..\..\..\artifacts\bin\$(MSBuildProjectName)\
+ ..\..\artifacts\obj\$(MSBuildProjectName)
+ ..\..\artifacts\bin\$(MSBuildProjectName)\
2.0
diff --git a/samples/InlineConstraintSample.Web/Startup.cs b/samples/InlineConstraintSample.Web/Startup.cs
new file mode 100644
index 0000000000..301c1ee6b2
--- /dev/null
+++ b/samples/InlineConstraintSample.Web/Startup.cs
@@ -0,0 +1,50 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using InlineConstraintSample.Web.Constraints;
+using Microsoft.AspNet.Builder;
+using Microsoft.AspNet.Localization;
+using Microsoft.Extensions.DependencyInjection;
+
+namespace InlineConstraintSample.Web
+{
+ public class Startup
+ {
+ // Set up application services
+ public void ConfigureServices(IServiceCollection services)
+ {
+ services.ConfigureRouting(
+ routeOptions => routeOptions.ConstraintMap.Add(
+ "IsbnDigitScheme10",
+ typeof(IsbnDigitScheme10Constraint)));
+
+ services.ConfigureRouting(
+ routeOptions => routeOptions.ConstraintMap.Add(
+ "IsbnDigitScheme13",
+ typeof(IsbnDigitScheme10Constraint)));
+
+ // Update an existing constraint from ConstraintMap for test purpose.
+ services.ConfigureRouting(
+ routeOptions =>
+ {
+ if (routeOptions.ConstraintMap.ContainsKey("IsbnDigitScheme13"))
+ {
+ routeOptions.ConstraintMap["IsbnDigitScheme13"] = typeof(IsbnDigitScheme13Constraint);
+ }
+ });
+
+ // Add MVC services to the services container
+ services.AddMvc();
+ }
+
+ public void Configure(IApplicationBuilder app)
+ {
+ // Ignore ambient and client locale. Use same values as ReplaceCultureAttribute / CultureReplacerMiddleware.
+ var localizationOptions = new RequestLocalizationOptions();
+ localizationOptions.RequestCultureProviders.Clear();
+ app.UseRequestLocalization(localizationOptions, new RequestCulture("en-GB", "en-US"));
+
+ app.UseMvc();
+ }
+ }
+}
diff --git a/test/WebSites/InlineConstraintsWebSite/Views/Home/Index.cshtml b/samples/InlineConstraintSample.Web/Views/Home/Index.cshtml
similarity index 100%
rename from test/WebSites/InlineConstraintsWebSite/Views/Home/Index.cshtml
rename to samples/InlineConstraintSample.Web/Views/Home/Index.cshtml
diff --git a/test/WebSites/InlineConstraintsWebSite/Views/Shared/Error.cshtml b/samples/InlineConstraintSample.Web/Views/Shared/Error.cshtml
similarity index 100%
rename from test/WebSites/InlineConstraintsWebSite/Views/Shared/Error.cshtml
rename to samples/InlineConstraintSample.Web/Views/Shared/Error.cshtml
diff --git a/test/WebSites/InlineConstraintsWebSite/Views/Shared/_Layout.cshtml b/samples/InlineConstraintSample.Web/Views/Shared/_Layout.cshtml
similarity index 100%
rename from test/WebSites/InlineConstraintsWebSite/Views/Shared/_Layout.cshtml
rename to samples/InlineConstraintSample.Web/Views/Shared/_Layout.cshtml
diff --git a/samples/InlineConstraintSample.Web/project.json b/samples/InlineConstraintSample.Web/project.json
new file mode 100644
index 0000000000..28e88dae79
--- /dev/null
+++ b/samples/InlineConstraintSample.Web/project.json
@@ -0,0 +1,15 @@
+{
+ "commands": {
+ "web": "Microsoft.AspNet.Server.Kestrel",
+ "weblistener": "Microsoft.AspNet.Server.WebListener"
+ },
+ "dependencies": {
+ "Microsoft.AspNet.Mvc": "6.0.0-*",
+ "Microsoft.AspNet.Server.Kestrel": "1.0.0-*",
+ "Microsoft.AspNet.Server.WebListener": "1.0.0-*"
+ },
+ "frameworks": {
+ "dnx451": { },
+ "dnxcore50": { }
+ }
+}
diff --git a/test/WebSites/InlineConstraintsWebSite/readme.md b/samples/InlineConstraintSample.Web/readme.md
similarity index 63%
rename from test/WebSites/InlineConstraintsWebSite/readme.md
rename to samples/InlineConstraintSample.Web/readme.md
index cd28a097df..4c9f106fac 100644
--- a/test/WebSites/InlineConstraintsWebSite/readme.md
+++ b/samples/InlineConstraintSample.Web/readme.md
@@ -1,6 +1,6 @@
-InlineConstraintsWebSite
+InlineConstraintSample.Web
===
-This web site illustrates how to use inline route constraints with traditional
-routes. The startup class in its configure method reads the routes which are added to configuration by the
+This web site illustrates how to use inline route constraints with traditional
+routes. The startup class in its configure method reads the routes which are added to configuration by the
test methods.
diff --git a/samples/InlineConstraintSample.Web/wwwroot/web.config b/samples/InlineConstraintSample.Web/wwwroot/web.config
new file mode 100644
index 0000000000..8485f6719f
--- /dev/null
+++ b/samples/InlineConstraintSample.Web/wwwroot/web.config
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/test/WebSites/JsonPatchWebSite/Controllers/JsonPatchController.cs b/samples/JsonPatchSample.Web/Controllers/HomeController.cs
similarity index 95%
rename from test/WebSites/JsonPatchWebSite/Controllers/JsonPatchController.cs
rename to samples/JsonPatchSample.Web/Controllers/HomeController.cs
index c2cc1dab94..c63538be28 100644
--- a/test/WebSites/JsonPatchWebSite/Controllers/JsonPatchController.cs
+++ b/samples/JsonPatchSample.Web/Controllers/HomeController.cs
@@ -2,14 +2,14 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Generic;
-using JsonPatchWebSite.Models;
+using JsonPatchSample.Web.Models;
using Microsoft.AspNet.JsonPatch;
using Microsoft.AspNet.Mvc;
-namespace JsonPatchWebSite.Controllers
+namespace JsonPatchSample.Web.Controllers
{
[Route("jsonpatch/[action]")]
- public class JsonPatchController : Controller
+ public class HomeController : Controller
{
[HttpPatch]
public IActionResult JsonPatchWithModelState([FromBody] JsonPatchDocument patchDoc)
diff --git a/test/WebSites/JsonPatchWebSite/JsonPatchWebSite.xproj b/samples/JsonPatchSample.Web/JsonPatchSample.Web.xproj
similarity index 81%
rename from test/WebSites/JsonPatchWebSite/JsonPatchWebSite.xproj
rename to samples/JsonPatchSample.Web/JsonPatchSample.Web.xproj
index b2e8713385..82ef61f86e 100644
--- a/test/WebSites/JsonPatchWebSite/JsonPatchWebSite.xproj
+++ b/samples/JsonPatchSample.Web/JsonPatchSample.Web.xproj
@@ -7,8 +7,8 @@
dab1252d-577c-4912-98be-1a812bf83f86
- ..\..\..\artifacts\obj\$(MSBuildProjectName)
- ..\..\..\artifacts\bin\$(MSBuildProjectName)\
+ ..\..\artifacts\obj\$(MSBuildProjectName)
+ ..\..\artifacts\bin\$(MSBuildProjectName)\
2.0
diff --git a/test/WebSites/JsonPatchWebSite/Models/Product.cs b/samples/JsonPatchSample.Web/Models/Category.cs
similarity index 66%
rename from test/WebSites/JsonPatchWebSite/Models/Product.cs
rename to samples/JsonPatchSample.Web/Models/Category.cs
index 92bdd2e08c..ac3a3b3fae 100644
--- a/test/WebSites/JsonPatchWebSite/Models/Product.cs
+++ b/samples/JsonPatchSample.Web/Models/Category.cs
@@ -3,15 +3,8 @@
using Newtonsoft.Json;
-namespace JsonPatchWebSite.Models
+namespace JsonPatchSample.Web.Models
{
- public class Product
- {
- public string ProductName { get; set; }
-
- public Category ProductCategory { get; set; }
- }
-
[JsonConverter(typeof(ProductCategoryConverter))]
public class Category
{
diff --git a/test/WebSites/JsonPatchWebSite/Models/Customer.cs b/samples/JsonPatchSample.Web/Models/Customer.cs
similarity index 89%
rename from test/WebSites/JsonPatchWebSite/Models/Customer.cs
rename to samples/JsonPatchSample.Web/Models/Customer.cs
index b96b2a12b2..a1c8305291 100644
--- a/test/WebSites/JsonPatchWebSite/Models/Customer.cs
+++ b/samples/JsonPatchSample.Web/Models/Customer.cs
@@ -3,7 +3,7 @@
using System.Collections.Generic;
-namespace JsonPatchWebSite.Models
+namespace JsonPatchSample.Web.Models
{
public class Customer
{
diff --git a/test/WebSites/JsonPatchWebSite/Models/Order.cs b/samples/JsonPatchSample.Web/Models/Order.cs
similarity index 90%
rename from test/WebSites/JsonPatchWebSite/Models/Order.cs
rename to samples/JsonPatchSample.Web/Models/Order.cs
index 57ca1cd6e3..d35b358838 100644
--- a/test/WebSites/JsonPatchWebSite/Models/Order.cs
+++ b/samples/JsonPatchSample.Web/Models/Order.cs
@@ -3,7 +3,7 @@
using Newtonsoft.Json;
-namespace JsonPatchWebSite.Models
+namespace JsonPatchSample.Web.Models
{
public class Order
{
diff --git a/test/WebSites/ModelBindingWebSite/Models/ArrayOfPersonWithNoProperties.cs b/samples/JsonPatchSample.Web/Models/Product.cs
similarity index 53%
rename from test/WebSites/ModelBindingWebSite/Models/ArrayOfPersonWithNoProperties.cs
rename to samples/JsonPatchSample.Web/Models/Product.cs
index 8e820015f1..a3453206bc 100644
--- a/test/WebSites/ModelBindingWebSite/Models/ArrayOfPersonWithNoProperties.cs
+++ b/samples/JsonPatchSample.Web/Models/Product.cs
@@ -1,10 +1,12 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-namespace ModelBindingWebSite.Models
+namespace JsonPatchSample.Web.Models
{
- public class ArrayOfPersonWithNoProperties
+ public class Product
{
- public PersonWithNoProperties[] people { get; set; }
+ public string ProductName { get; set; }
+
+ public Category ProductCategory { get; set; }
}
}
diff --git a/test/WebSites/JsonPatchWebSite/ProductCategoryConverter.cs b/samples/JsonPatchSample.Web/ProductCategoryConverter.cs
similarity index 96%
rename from test/WebSites/JsonPatchWebSite/ProductCategoryConverter.cs
rename to samples/JsonPatchSample.Web/ProductCategoryConverter.cs
index 0e946c4245..1135d1433f 100644
--- a/test/WebSites/JsonPatchWebSite/ProductCategoryConverter.cs
+++ b/samples/JsonPatchSample.Web/ProductCategoryConverter.cs
@@ -3,11 +3,11 @@
using System;
using System.Reflection;
-using JsonPatchWebSite.Models;
+using JsonPatchSample.Web.Models;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
-namespace JsonPatchWebSite
+namespace JsonPatchSample.Web
{
public class ProductCategoryConverter : JsonConverter
{
diff --git a/test/WebSites/JsonPatchWebSite/ReplaceOrderTypeConverter.cs b/samples/JsonPatchSample.Web/ReplaceOrderTypeConverter.cs
similarity index 96%
rename from test/WebSites/JsonPatchWebSite/ReplaceOrderTypeConverter.cs
rename to samples/JsonPatchSample.Web/ReplaceOrderTypeConverter.cs
index 01dd1f09a1..ea040b7d33 100644
--- a/test/WebSites/JsonPatchWebSite/ReplaceOrderTypeConverter.cs
+++ b/samples/JsonPatchSample.Web/ReplaceOrderTypeConverter.cs
@@ -4,7 +4,7 @@
using System;
using Newtonsoft.Json;
-namespace JsonPatchWebSite
+namespace JsonPatchSample.Web
{
public class ReplaceOrderTypeConverter : JsonConverter
{
diff --git a/test/WebSites/JsonPatchWebSite/Startup.cs b/samples/JsonPatchSample.Web/Startup.cs
similarity index 90%
rename from test/WebSites/JsonPatchWebSite/Startup.cs
rename to samples/JsonPatchSample.Web/Startup.cs
index 6a0f85d1b8..069e6f5d28 100644
--- a/test/WebSites/JsonPatchWebSite/Startup.cs
+++ b/samples/JsonPatchSample.Web/Startup.cs
@@ -4,7 +4,7 @@
using Microsoft.AspNet.Builder;
using Microsoft.Extensions.DependencyInjection;
-namespace JsonPatchWebSite
+namespace JsonPatchSample.Web
{
public class Startup
{
@@ -17,8 +17,6 @@ namespace JsonPatchWebSite
public void Configure(IApplicationBuilder app)
{
- app.UseCultureReplacer();
-
// Add MVC to the request pipeline
app.UseMvc();
}
diff --git a/samples/JsonPatchSample.Web/project.json b/samples/JsonPatchSample.Web/project.json
new file mode 100644
index 0000000000..39e5b21da1
--- /dev/null
+++ b/samples/JsonPatchSample.Web/project.json
@@ -0,0 +1,15 @@
+{
+ "commands": {
+ "web": "Microsoft.AspNet.Server.Kestrel",
+ "weblistener": "Microsoft.AspNet.Server.WebListener"
+ },
+ "dependencies": {
+ "Microsoft.AspNet.Mvc": "6.0.0-*",
+ "Microsoft.AspNet.Server.Kestrel": "1.0.0-*",
+ "Microsoft.AspNet.Server.WebListener": "1.0.0-*"
+ },
+ "frameworks": {
+ "dnx451": { },
+ "dnxcore50": { }
+ }
+}
diff --git a/test/WebSites/JsonPatchWebSite/readme.md b/samples/JsonPatchSample.Web/readme.md
similarity index 79%
rename from test/WebSites/JsonPatchWebSite/readme.md
rename to samples/JsonPatchSample.Web/readme.md
index 970d684af2..0d37c5b539 100644
--- a/test/WebSites/JsonPatchWebSite/readme.md
+++ b/samples/JsonPatchSample.Web/readme.md
@@ -1,4 +1,4 @@
-JsonPatchWebSite
+JsonPatchSample.Web
===
This web site illustrates how to use JSON Patch operation on an object.
diff --git a/samples/JsonPatchSample.Web/wwwroot/web.config b/samples/JsonPatchSample.Web/wwwroot/web.config
new file mode 100644
index 0000000000..8485f6719f
--- /dev/null
+++ b/samples/JsonPatchSample.Web/wwwroot/web.config
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/test/WebSites/LocalizationWebSite/Controllers/HomeController.cs b/samples/LocalizationSample.Web/Controllers/HomeController.cs
similarity index 92%
rename from test/WebSites/LocalizationWebSite/Controllers/HomeController.cs
rename to samples/LocalizationSample.Web/Controllers/HomeController.cs
index bcb8724459..2e43cd241c 100644
--- a/test/WebSites/LocalizationWebSite/Controllers/HomeController.cs
+++ b/samples/LocalizationSample.Web/Controllers/HomeController.cs
@@ -1,11 +1,11 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-using LocalizationWebSite.Models;
+using LocalizationSample.Web.Models;
using Microsoft.AspNet.Mvc;
using Microsoft.AspNet.Mvc.Localization;
-namespace LocalizationWebSite.Controllers
+namespace LocalizationSample.Web.Controllers
{
public class HomeController : Controller
{
diff --git a/test/WebSites/LocalizationWebSite/LocalizationWebSite.xproj b/samples/LocalizationSample.Web/LocalizationSample.Web.xproj
similarity index 81%
rename from test/WebSites/LocalizationWebSite/LocalizationWebSite.xproj
rename to samples/LocalizationSample.Web/LocalizationSample.Web.xproj
index ed9391e930..96e4f24563 100644
--- a/test/WebSites/LocalizationWebSite/LocalizationWebSite.xproj
+++ b/samples/LocalizationSample.Web/LocalizationSample.Web.xproj
@@ -7,8 +7,8 @@
fcfe6024-2720-49b4-8257-9dbc6114f0f1
- ..\..\..\artifacts\obj\$(MSBuildProjectName)
- ..\..\..\artifacts\bin\$(MSBuildProjectName)\
+ ..\..\artifacts\obj\$(MSBuildProjectName)
+ ..\..\artifacts\bin\$(MSBuildProjectName)\
2.0
diff --git a/samples/LocalizationSample.Web/Models/Product.cs b/samples/LocalizationSample.Web/Models/Product.cs
new file mode 100644
index 0000000000..49217992b7
--- /dev/null
+++ b/samples/LocalizationSample.Web/Models/Product.cs
@@ -0,0 +1,13 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.ComponentModel.DataAnnotations;
+
+namespace LocalizationSample.Web.Models
+{
+ public class Product
+ {
+ [Required(ErrorMessage = "ProductName")]
+ public string ProductName { get; set; }
+ }
+}
diff --git a/test/WebSites/LocalizationWebSite/Models/User.cs b/samples/LocalizationSample.Web/Models/User.cs
similarity index 69%
rename from test/WebSites/LocalizationWebSite/Models/User.cs
rename to samples/LocalizationSample.Web/Models/User.cs
index 632be4255f..93c64408ad 100644
--- a/test/WebSites/LocalizationWebSite/Models/User.cs
+++ b/samples/LocalizationSample.Web/Models/User.cs
@@ -3,7 +3,7 @@
using System.ComponentModel.DataAnnotations;
-namespace LocalizationWebSite.Models
+namespace LocalizationSample.Web.Models
{
public class User
{
@@ -12,10 +12,4 @@ namespace LocalizationWebSite.Models
public Product Product { get; set; }
}
-
- public class Product
- {
- [Required(ErrorMessage = "ProductName")]
- public string ProductName { get; set; }
- }
}
diff --git a/test/WebSites/LocalizationWebSite/Resources/LocalizationWebSite.Controllers.HomeController.fr.resx b/samples/LocalizationSample.Web/Resources/LocalizationSample.Web.Controllers.HomeController.fr.resx
similarity index 100%
rename from test/WebSites/LocalizationWebSite/Resources/LocalizationWebSite.Controllers.HomeController.fr.resx
rename to samples/LocalizationSample.Web/Resources/LocalizationSample.Web.Controllers.HomeController.fr.resx
diff --git a/test/WebSites/LocalizationWebSite/Resources/LocalizationWebSite.Models.Product.fr.resx b/samples/LocalizationSample.Web/Resources/LocalizationSample.Web.Models.Product.fr.resx
similarity index 100%
rename from test/WebSites/LocalizationWebSite/Resources/LocalizationWebSite.Models.Product.fr.resx
rename to samples/LocalizationSample.Web/Resources/LocalizationSample.Web.Models.Product.fr.resx
diff --git a/test/WebSites/LocalizationWebSite/Resources/LocalizationWebSite.Models.User.fr.resx b/samples/LocalizationSample.Web/Resources/LocalizationSample.Web.Models.User.fr.resx
similarity index 100%
rename from test/WebSites/LocalizationWebSite/Resources/LocalizationWebSite.Models.User.fr.resx
rename to samples/LocalizationSample.Web/Resources/LocalizationSample.Web.Models.User.fr.resx
diff --git a/test/WebSites/LocalizationWebSite/Resources/Views.Home.Locpage.cshtml.en-GB.resx b/samples/LocalizationSample.Web/Resources/Views.Home.Locpage.cshtml.en-GB.resx
similarity index 100%
rename from test/WebSites/LocalizationWebSite/Resources/Views.Home.Locpage.cshtml.en-GB.resx
rename to samples/LocalizationSample.Web/Resources/Views.Home.Locpage.cshtml.en-GB.resx
diff --git a/test/WebSites/LocalizationWebSite/Resources/Views.Home.Locpage.cshtml.fr.resx b/samples/LocalizationSample.Web/Resources/Views.Home.Locpage.cshtml.fr.resx
similarity index 100%
rename from test/WebSites/LocalizationWebSite/Resources/Views.Home.Locpage.cshtml.fr.resx
rename to samples/LocalizationSample.Web/Resources/Views.Home.Locpage.cshtml.fr.resx
diff --git a/test/WebSites/LocalizationWebSite/Resources/Views.Shared._LocalizationLayout.cshtml.fr.resx b/samples/LocalizationSample.Web/Resources/Views.Shared._LocalizationLayout.cshtml.fr.resx
similarity index 100%
rename from test/WebSites/LocalizationWebSite/Resources/Views.Shared._LocalizationLayout.cshtml.fr.resx
rename to samples/LocalizationSample.Web/Resources/Views.Shared._LocalizationLayout.cshtml.fr.resx
diff --git a/test/WebSites/LocalizationWebSite/Startup.cs b/samples/LocalizationSample.Web/Startup.cs
similarity index 94%
rename from test/WebSites/LocalizationWebSite/Startup.cs
rename to samples/LocalizationSample.Web/Startup.cs
index b1094b611e..46de9a60d7 100644
--- a/test/WebSites/LocalizationWebSite/Startup.cs
+++ b/samples/LocalizationSample.Web/Startup.cs
@@ -7,7 +7,7 @@ using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Localization;
using Microsoft.Extensions.DependencyInjection;
-namespace LocalizationWebSite
+namespace LocalizationSample.Web
{
public class Startup
{
@@ -21,8 +21,6 @@ namespace LocalizationWebSite
public void Configure(IApplicationBuilder app)
{
- app.UseCultureReplacer();
-
var options = new RequestLocalizationOptions
{
SupportedCultures = new List
diff --git a/test/WebSites/LocalizationWebSite/Views/Home/GetInvalidUser.cshtml b/samples/LocalizationSample.Web/Views/Home/GetInvalidUser.cshtml
similarity index 76%
rename from test/WebSites/LocalizationWebSite/Views/Home/GetInvalidUser.cshtml
rename to samples/LocalizationSample.Web/Views/Home/GetInvalidUser.cshtml
index 08fb71fc8a..5269a7aaed 100644
--- a/test/WebSites/LocalizationWebSite/Views/Home/GetInvalidUser.cshtml
+++ b/samples/LocalizationSample.Web/Views/Home/GetInvalidUser.cshtml
@@ -1,4 +1,4 @@
-@model LocalizationWebSite.Models.User
+@model LocalizationSample.Web.Models.User
@Html.ValidationMessage("Name")
@Html.ValidationMessage("Product.ProductName")
diff --git a/test/WebSites/LocalizationWebSite/Views/Home/Index.cshtml b/samples/LocalizationSample.Web/Views/Home/Index.cshtml
similarity index 100%
rename from test/WebSites/LocalizationWebSite/Views/Home/Index.cshtml
rename to samples/LocalizationSample.Web/Views/Home/Index.cshtml
diff --git a/test/WebSites/LocalizationWebSite/Views/Home/Index.en-GB.cshtml b/samples/LocalizationSample.Web/Views/Home/Index.en-GB.cshtml
similarity index 100%
rename from test/WebSites/LocalizationWebSite/Views/Home/Index.en-GB.cshtml
rename to samples/LocalizationSample.Web/Views/Home/Index.en-GB.cshtml
diff --git a/test/WebSites/LocalizationWebSite/Views/Home/Index.fr.cshtml b/samples/LocalizationSample.Web/Views/Home/Index.fr.cshtml
similarity index 100%
rename from test/WebSites/LocalizationWebSite/Views/Home/Index.fr.cshtml
rename to samples/LocalizationSample.Web/Views/Home/Index.fr.cshtml
diff --git a/test/WebSites/LocalizationWebSite/Views/Home/Locpage.cshtml b/samples/LocalizationSample.Web/Views/Home/Locpage.cshtml
similarity index 100%
rename from test/WebSites/LocalizationWebSite/Views/Home/Locpage.cshtml
rename to samples/LocalizationSample.Web/Views/Home/Locpage.cshtml
diff --git a/test/WebSites/LocalizationWebSite/Views/Home/_MyPartial.cshtml b/samples/LocalizationSample.Web/Views/Home/_MyPartial.cshtml
similarity index 100%
rename from test/WebSites/LocalizationWebSite/Views/Home/_MyPartial.cshtml
rename to samples/LocalizationSample.Web/Views/Home/_MyPartial.cshtml
diff --git a/test/WebSites/LocalizationWebSite/Views/Home/_Partial.cshtml b/samples/LocalizationSample.Web/Views/Home/_Partial.cshtml
similarity index 100%
rename from test/WebSites/LocalizationWebSite/Views/Home/_Partial.cshtml
rename to samples/LocalizationSample.Web/Views/Home/_Partial.cshtml
diff --git a/test/WebSites/LocalizationWebSite/Views/Home/_Partial.fr.cshtml b/samples/LocalizationSample.Web/Views/Home/_Partial.fr.cshtml
similarity index 100%
rename from test/WebSites/LocalizationWebSite/Views/Home/_Partial.fr.cshtml
rename to samples/LocalizationSample.Web/Views/Home/_Partial.fr.cshtml
diff --git a/test/WebSites/LocalizationWebSite/Views/Shared/_LocalizationLayout.cshtml b/samples/LocalizationSample.Web/Views/Shared/_LocalizationLayout.cshtml
similarity index 100%
rename from test/WebSites/LocalizationWebSite/Views/Shared/_LocalizationLayout.cshtml
rename to samples/LocalizationSample.Web/Views/Shared/_LocalizationLayout.cshtml
diff --git a/test/WebSites/LocalizationWebSite/Views/Shared/_MyLayout.cshtml b/samples/LocalizationSample.Web/Views/Shared/_MyLayout.cshtml
similarity index 100%
rename from test/WebSites/LocalizationWebSite/Views/Shared/_MyLayout.cshtml
rename to samples/LocalizationSample.Web/Views/Shared/_MyLayout.cshtml
diff --git a/test/WebSites/LocalizationWebSite/Views/Shared/_MyLayout.fr.cshtml b/samples/LocalizationSample.Web/Views/Shared/_MyLayout.fr.cshtml
similarity index 100%
rename from test/WebSites/LocalizationWebSite/Views/Shared/_MyLayout.fr.cshtml
rename to samples/LocalizationSample.Web/Views/Shared/_MyLayout.fr.cshtml
diff --git a/test/WebSites/LocalizationWebSite/Views/Shared/_MyPartial.en-GB.cshtml b/samples/LocalizationSample.Web/Views/Shared/_MyPartial.en-GB.cshtml
similarity index 100%
rename from test/WebSites/LocalizationWebSite/Views/Shared/_MyPartial.en-GB.cshtml
rename to samples/LocalizationSample.Web/Views/Shared/_MyPartial.en-GB.cshtml
diff --git a/test/WebSites/LocalizationWebSite/Views/_ViewImports.cshtml b/samples/LocalizationSample.Web/Views/_ViewImports.cshtml
similarity index 57%
rename from test/WebSites/LocalizationWebSite/Views/_ViewImports.cshtml
rename to samples/LocalizationSample.Web/Views/_ViewImports.cshtml
index b3baa19d9e..ddcf2cbe81 100644
--- a/test/WebSites/LocalizationWebSite/Views/_ViewImports.cshtml
+++ b/samples/LocalizationSample.Web/Views/_ViewImports.cshtml
@@ -1,5 +1,5 @@
-@using LocalizationWebSite
-@using Microsoft.Extensions.Localization
+@using LocalizationSample.Web
@using Microsoft.AspNet.Mvc.Localization
+@using Microsoft.Extensions.Localization
@inject IViewLocalizer LocString
\ No newline at end of file
diff --git a/samples/LocalizationSample.Web/project.json b/samples/LocalizationSample.Web/project.json
new file mode 100644
index 0000000000..39e5b21da1
--- /dev/null
+++ b/samples/LocalizationSample.Web/project.json
@@ -0,0 +1,15 @@
+{
+ "commands": {
+ "web": "Microsoft.AspNet.Server.Kestrel",
+ "weblistener": "Microsoft.AspNet.Server.WebListener"
+ },
+ "dependencies": {
+ "Microsoft.AspNet.Mvc": "6.0.0-*",
+ "Microsoft.AspNet.Server.Kestrel": "1.0.0-*",
+ "Microsoft.AspNet.Server.WebListener": "1.0.0-*"
+ },
+ "frameworks": {
+ "dnx451": { },
+ "dnxcore50": { }
+ }
+}
diff --git a/samples/LocalizationSample.Web/readme.md b/samples/LocalizationSample.Web/readme.md
new file mode 100644
index 0000000000..ffb8f0e4a3
--- /dev/null
+++ b/samples/LocalizationSample.Web/readme.md
@@ -0,0 +1,4 @@
+LocalizationSample.Web
+===
+
+This web site illustrates use cases for MVC localization.
diff --git a/samples/LocalizationSample.Web/wwwroot/web.config b/samples/LocalizationSample.Web/wwwroot/web.config
new file mode 100644
index 0000000000..8485f6719f
--- /dev/null
+++ b/samples/LocalizationSample.Web/wwwroot/web.config
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/ActionResultTests.cs b/test/Microsoft.AspNet.Mvc.FunctionalTests/ActionResultTests.cs
deleted file mode 100644
index 336e4bd745..0000000000
--- a/test/Microsoft.AspNet.Mvc.FunctionalTests/ActionResultTests.cs
+++ /dev/null
@@ -1,315 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-using System;
-using System.Collections.Generic;
-using System.Net;
-using System.Net.Http;
-using System.Net.Http.Headers;
-using System.Text;
-using System.Threading.Tasks;
-using Xunit;
-
-namespace Microsoft.AspNet.Mvc.FunctionalTests
-{
- public class ActionResultTests : IClassFixture>
- {
- public ActionResultTests(MvcTestFixture fixture)
- {
- Client = fixture.Client;
- }
-
- public HttpClient Client { get; }
-
- [Fact]
- public async Task BadRequestResult_CanBeReturned()
- {
- // Arrange
- var input = "{\"SampleInt\":10}";
-
- var request = new HttpRequestMessage(
- HttpMethod.Post,
- "ActionResultsVerification/GetBadResult");
-
- request.Content = new StringContent(input, Encoding.UTF8, "application/json");
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
- Assert.Equal("", await response.Content.ReadAsStringAsync());
- }
-
- [Fact]
- public async Task CreatedResult_SetsRelativePathInLocationHeader()
- {
- // Arrange
- var request = new HttpRequestMessage(
- HttpMethod.Post,
- "ActionResultsVerification/GetCreatedRelative");
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.Created, response.StatusCode);
- Assert.Equal("1", response.Headers.Location.OriginalString);
- Assert.Equal("{\"SampleInt\":10,\"SampleString\":\"Foo\"}", await response.Content.ReadAsStringAsync());
- }
-
- [Fact]
- public async Task CreatedResult_SetsAbsolutePathInLocationHeader()
- {
- // Arrange
- var request = new HttpRequestMessage(
- HttpMethod.Post,
- "ActionResultsVerification/GetCreatedAbsolute");
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.Created, response.StatusCode);
- Assert.Equal("/ActionResultsVerification/GetDummy/1", response.Headers.Location.OriginalString);
- Assert.Equal("{\"SampleInt\":10,\"SampleString\":\"Foo\"}", await response.Content.ReadAsStringAsync());
- }
-
- [Fact]
- public async Task CreatedResult_SetsQualifiedPathInLocationHeader()
- {
- // Arrange
- var request = new HttpRequestMessage(
- HttpMethod.Post,
- "ActionResultsVerification/GetCreatedQualified");
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.Created, response.StatusCode);
- Assert.Equal(
- "http://localhost/ActionResultsVerification/GetDummy/1",
- response.Headers.Location.OriginalString);
- Assert.Equal("{\"SampleInt\":10,\"SampleString\":\"Foo\"}", await response.Content.ReadAsStringAsync());
- }
-
- [Fact]
- public async Task CreatedResult_SetsUriInLocationHeader()
- {
- // Arrange
- var request = new HttpRequestMessage(
- HttpMethod.Post,
- "ActionResultsVerification/GetCreatedUri");
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.Created, response.StatusCode);
- Assert.Equal("/ActionResultsVerification/GetDummy/1", response.Headers.Location.OriginalString);
- Assert.Equal("{\"SampleInt\":10,\"SampleString\":\"Foo\"}", await response.Content.ReadAsStringAsync());
- }
-
- [Fact]
- public async Task CreatedAtActionResult_GeneratesUri_WithActionAndController()
- {
- // Arrange
- var request = new HttpRequestMessage(
- HttpMethod.Post,
- "ActionResultsVerification/GetCreatedAtAction");
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.Created, response.StatusCode);
- Assert.Equal("http://localhost/ActionResultsVerification/GetDummy/1", response.Headers.Location.OriginalString);
- Assert.Equal("{\"SampleInt\":10,\"SampleString\":\"Foo\"}", await response.Content.ReadAsStringAsync());
- }
-
- [Fact]
- public async Task CreatedAtRouteResult_GeneratesUri_WithRouteValues()
- {
- // Arrange
- var request = new HttpRequestMessage(
- HttpMethod.Post,
- "ActionResultsVerification/GetCreatedAtRoute");
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.Created, response.StatusCode);
- Assert.Equal("http://localhost/ActionResultsVerification/GetDummy/1", response.Headers.Location.OriginalString);
- Assert.Equal("{\"SampleInt\":10,\"SampleString\":\"Foo\"}", await response.Content.ReadAsStringAsync());
- }
-
- [Fact]
- public async Task CreatedAtRouteResult_GeneratesUri_WithRouteName()
- {
- // Arrange
- var request = new HttpRequestMessage(
- HttpMethod.Post,
- "ActionResultsVerification/GetCreatedAtRouteWithRouteName");
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.Created, response.StatusCode);
- Assert.Equal("http://localhost/foo/ActionResultsVerification/GetDummy/1", response.Headers.Location.OriginalString);
- Assert.Equal("{\"SampleInt\":10,\"SampleString\":\"Foo\"}", await response.Content.ReadAsStringAsync());
- }
-
- [Fact]
- public async Task SerializableError_CanSerializeNormalObjects()
- {
- // Arrange
- var input = "" +
- "" +
- "2foo";
- var request = new HttpRequestMessage(HttpMethod.Post, "Home/GetCustomErrorObject");
- request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json"));
- request.Content = new StringContent(input, Encoding.UTF8, "application/xml");
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
- Assert.Equal("[\"Something went wrong with the model.\"]",
- await response.Content.ReadAsStringAsync());
- }
-
- [Fact]
- public async Task ContentResult_WritesContent_SetsDefaultContentTypeAndEncoding()
- {
- // Arrange
- var request = new HttpRequestMessage(
- HttpMethod.Post,
- "ActionResultsVerification/GetContentResult");
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- Assert.Equal("content", await response.Content.ReadAsStringAsync());
- Assert.Equal("text/plain", response.Content.Headers.ContentType.MediaType);
- Assert.Equal("utf-8", response.Content.Headers.ContentType.CharSet);
- }
-
- [Fact]
- public async Task ContentResult_WritesContent_SetsContentType_UsesDefaultEncoding_AndNoCharset()
- {
- // Arrange
- var request = new HttpRequestMessage(
- HttpMethod.Post,
- "ActionResultsVerification/GetContentResultWithContentType");
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- Assert.Equal("application/json", response.Content.Headers.ContentType.MediaType);
- Assert.Equal("content", await response.Content.ReadAsStringAsync());
- }
-
- [Fact]
- public async Task ContentResult_WritesContent_SetsContentTypeAndEncoding()
- {
- // Arrange
- var request = new HttpRequestMessage(
- HttpMethod.Post,
- "ActionResultsVerification/GetContentResultWithContentTypeAndEncoding");
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- Assert.Equal("application/json", response.Content.Headers.ContentType.MediaType);
- Assert.Equal("us-ascii", response.Content.Headers.ContentType.CharSet);
- Assert.Equal("content", await response.Content.ReadAsStringAsync());
- }
-
- [Fact]
- public async Task ObjectResult_WithStatusCodeAndNoContent_SetsSameStatusCode()
- {
- // Arrange
- var request = new HttpRequestMessage(
- HttpMethod.Get,
- "ActionResultsVerification/GetObjectResultWithNoContent");
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.Created, response.StatusCode);
- }
-
- [Fact]
- public async Task HttpNotFoundObjectResult_NoResponseContent()
- {
- // Arrange
- var request = new HttpRequestMessage(
- HttpMethod.Get,
- "ActionResultsVerification/GetNotFoundObjectResult");
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.NotFound, response.StatusCode);
- Assert.Equal("", await response.Content.ReadAsStringAsync());
- }
-
- [Fact]
- public async Task HttpNotFoundObjectResult_WithResponseContent()
- {
- // Arrange
- var request = new HttpRequestMessage(
- HttpMethod.Post,
- "ActionResultsVerification/GetNotFoundObjectResultWithContent");
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.NotFound, response.StatusCode);
- Assert.Equal("{\"SampleInt\":10,\"SampleString\":\"Foo\"}", await response.Content.ReadAsStringAsync());
- }
-
- [Fact]
- public async Task HttpNotFoundObjectResult_WithDisposableObject()
- {
- // Arrange
- var nameValueCollection = new List>
- {
- new KeyValuePair("guid", Guid.NewGuid().ToString()),
- };
-
- // Act
- var response1 = await Client.PostAsync(
- "/ActionResultsVerification/GetDisposeCalled",
- new FormUrlEncodedContent(nameValueCollection));
-
- await Client.PostAsync(
- "/ActionResultsVerification/GetNotFoundObjectResultWithDisposableObject",
- new FormUrlEncodedContent(nameValueCollection));
-
- var response2 = await Client.PostAsync(
- "/ActionResultsVerification/GetDisposeCalled",
- new FormUrlEncodedContent(nameValueCollection));
-
- // Assert
- var isDisposed = Convert.ToBoolean(await response1.Content.ReadAsStringAsync());
- Assert.False(isDisposed);
-
- isDisposed = Convert.ToBoolean(await response2.Content.ReadAsStringAsync());
- Assert.True(isDisposed);
- }
- }
-}
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/ActivatorTests.cs b/test/Microsoft.AspNet.Mvc.FunctionalTests/ActivatorTests.cs
deleted file mode 100644
index afde2fe3b7..0000000000
--- a/test/Microsoft.AspNet.Mvc.FunctionalTests/ActivatorTests.cs
+++ /dev/null
@@ -1,156 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-using System;
-using System.Net.Http;
-using System.Threading.Tasks;
-using Xunit;
-
-namespace Microsoft.AspNet.Mvc.FunctionalTests
-{
- public class ActivatorTests : IClassFixture>
- {
- public ActivatorTests(MvcTestFixture fixture)
- {
- Client = fixture.Client;
- }
-
- public HttpClient Client { get; }
-
- [Fact]
- public async Task ControllerThatCannotBeActivated_ThrowsWhenAttemptedToBeInvoked()
- {
- // Arrange
- var expectedMessage =
- "Unable to resolve service for type 'ActivatorWebSite.CannotBeActivatedController+FakeType' while " +
- "attempting to activate 'ActivatorWebSite.CannotBeActivatedController'.";
-
- // Act & Assert
- var response = await Client.GetAsync("CannotBeActivated/Index");
-
- var exception = response.GetServerException();
- Assert.Equal(typeof(InvalidOperationException).FullName, exception.ExceptionType);
- Assert.Equal(expectedMessage, exception.ExceptionMessage);
- }
-
- [Fact]
- public async Task PropertiesForPocoControllersAreInitialized()
- {
- // Arrange
- var expected = "4|some-text";
-
- // Act
- var response = await Client.GetAsync("Plain?foo=some-text");
-
- // Assert
- var headerValue = Assert.Single(response.Headers.GetValues("X-Fake-Header"));
- Assert.Equal("Fake-Value", headerValue);
- var body = await response.Content.ReadAsStringAsync();
- Assert.Equal(expected, body);
- }
-
- [Fact]
- public async Task PropertiesForTypesDerivingFromControllerAreInitialized()
- {
- // Arrange
- var expected = "Hello world";
-
- // Act
- var body = await Client.GetStringAsync("Regular");
-
- // Assert
- Assert.Equal(expected, body);
- }
-
- [Fact]
- public async Task ViewActivator_ActivatesDefaultInjectedProperties()
- {
- // Arrange
- var expected = @" world! /View/ConsumeServicesFromBaseType";
-
- // Act
- var body = await Client.GetStringAsync("View/ConsumeDefaultProperties");
-
- // Assert
- Assert.Equal(expected, body.Trim());
- }
-
- [Fact]
- public async Task ViewActivator_ActivatesAndContextualizesInjectedServices()
- {
- // Arrange
- var expected = "4 test-value";
-
- // Act
- var body = await Client.GetStringAsync("View/ConsumeInjectedService?test=test-value");
-
- // Assert
- Assert.Equal(expected, body.Trim());
- }
-
- [Fact]
- public async Task ViewActivator_ActivatesServicesFromBaseType()
- {
- // Arrange
- var expected = @"/content/scripts/test.js";
-
- // Act
- var body = await Client.GetStringAsync("View/ConsumeServicesFromBaseType");
-
- // Assert
- Assert.Equal(expected, body.Trim());
- }
-
- [Fact]
- public async Task ViewComponentActivator_Activates()
- {
- // Arrange
- var expected = @"Random Number:4";
-
- // Act
- var body = await Client.GetStringAsync("View/ConsumeViewComponent");
-
- // Assert
- Assert.Equal(expected, body.Trim());
- }
-
-
- [Fact]
- public async Task ViewComponentThatCannotBeActivated_ThrowsWhenAttemptedToBeInvoked()
- {
- // Arrange
- var expectedMessage =
- "Unable to resolve service for type 'ActivatorWebSite.CannotBeActivatedComponent+FakeType' " +
- "while attempting to activate 'ActivatorWebSite.CannotBeActivatedComponent'.";
-
- // Act & Assert
- var response = await Client.GetAsync("View/ConsumeCannotBeActivatedComponent");
-
- var exception = response.GetServerException();
- Assert.Equal(typeof(InvalidOperationException).FullName, exception.ExceptionType);
- Assert.Equal(expectedMessage, exception.ExceptionMessage);
- }
-
- [Fact]
- public async Task TagHelperActivation_ConstructorInjection_RendersProperly()
- {
- // Arrange
- var expected = "Activation Test
" +
- Environment.NewLine +
- "FakeFakeFake
" +
- Environment.NewLine +
- "" +
- "" +
- "" +
- Environment.NewLine +
- "" +
- "";
-
- // Act
- var body = await Client.GetStringAsync("View/UseTagHelper");
-
- // Assert
- Assert.Equal(expected, body.Trim(), ignoreLineEndingDifferences: true);
- }
- }
-}
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/ApplicationModelTest.cs b/test/Microsoft.AspNet.Mvc.FunctionalTests/ApplicationModelTest.cs
index 3f9b7c5b4d..7831666a2f 100644
--- a/test/Microsoft.AspNet.Mvc.FunctionalTests/ApplicationModelTest.cs
+++ b/test/Microsoft.AspNet.Mvc.FunctionalTests/ApplicationModelTest.cs
@@ -99,7 +99,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
public async Task ApplicationModelExtensions_AddsConventionToAllControllers()
{
// Arrange & Act
- var response = await Client.GetAsync("http://localhost/Lisence/GetLisence");
+ var response = await Client.GetAsync("http://localhost/License/GetLicense");
// Assert
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/ControllerDiscoveryConventionTests.cs b/test/Microsoft.AspNet.Mvc.FunctionalTests/ControllerDiscoveryConventionTests.cs
deleted file mode 100644
index c5b07d56df..0000000000
--- a/test/Microsoft.AspNet.Mvc.FunctionalTests/ControllerDiscoveryConventionTests.cs
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-using System.Net;
-using System.Net.Http;
-using System.Threading.Tasks;
-using Xunit;
-
-namespace Microsoft.AspNet.Mvc.FunctionalTests
-{
- public class ControllerDiscoveryConventionTests :
- IClassFixture>,
- IClassFixture>
- {
- public ControllerDiscoveryConventionTests(
- MvcTestFixture fixture,
- FilteredDefaultAssemblyProviderFixture filteredFixture)
- {
- Client = fixture.Client;
- FilteredClient = filteredFixture.Client;
- }
-
- public HttpClient Client { get; }
-
- public HttpClient FilteredClient { get; }
-
- [Fact]
- public async Task AbstractControllers_AreSkipped()
- {
- // Arrange & Act
- var response = await Client.GetAsync("Abstract/GetValue");
-
- // Assert
- Assert.Equal(HttpStatusCode.NotFound, response.StatusCode);
- }
-
- [Fact]
- public async Task TypesDerivingFromControllerBaseTypesThatDoNotReferenceMvc_AreSkipped()
- {
- // Arrange & Act
- var response = await Client.GetAsync("SqlTransactionManager/GetValue");
-
- // Assert
- Assert.Equal(HttpStatusCode.NotFound, response.StatusCode);
- }
-
- [Fact]
- public async Task TypesMarkedWithNonController_AreSkipped()
- {
- // Arrange & Act
- var response = await Client.GetAsync("NonController/GetValue");
-
- // Assert
- Assert.Equal(HttpStatusCode.NotFound, response.StatusCode);
- }
-
- [Fact]
- public async Task PocoTypesWithControllerSuffix_AreDiscovered()
- {
- // Arrange & Act
- var response = await Client.GetAsync("Poco/GetValue");
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- Assert.Equal("PocoController", await response.Content.ReadAsStringAsync());
- }
-
- [Fact]
- public async Task TypesDerivingFromTypesWithControllerSuffix_AreDiscovered()
- {
- // Arrange & Act
- var response = await Client.GetAsync("ChildOfAbstract/GetValue");
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- Assert.Equal("AbstractController", await response.Content.ReadAsStringAsync());
- }
-
- [Fact]
- public async Task TypesDerivingFromApiController_AreDiscovered()
- {
- // Arrange & Act
- var response = await FilteredClient.GetAsync("PersonApi/GetValue");
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- Assert.Equal("PersonApi", await response.Content.ReadAsStringAsync());
- }
- }
-}
diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/CustomRouteTest.cs b/test/Microsoft.AspNet.Mvc.FunctionalTests/CustomRouteSampleTest.cs
similarity index 87%
rename from test/Microsoft.AspNet.Mvc.FunctionalTests/CustomRouteTest.cs
rename to test/Microsoft.AspNet.Mvc.FunctionalTests/CustomRouteSampleTest.cs
index cacb941b95..e62c70c579 100644
--- a/test/Microsoft.AspNet.Mvc.FunctionalTests/CustomRouteTest.cs
+++ b/test/Microsoft.AspNet.Mvc.FunctionalTests/CustomRouteSampleTest.cs
@@ -8,9 +8,9 @@ using Xunit;
namespace Microsoft.AspNet.Mvc.FunctionalTests
{
- public class CustomRouteTest : IClassFixture>
+ public class CustomRouteSampleTest : IClassFixture>
{
- public CustomRouteTest(MvcTestFixture fixture)
+ public CustomRouteSampleTest(MvcTestFixture fixture)
{
Client = fixture.Client;
}
@@ -24,7 +24,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
public async Task RouteToLocale_ConventionalRoute_BasedOnUser(string user, string expected)
{
// Arrange
- var request = new HttpRequestMessage(HttpMethod.Get, "http://localhost/CustomRoute_Products/Index");
+ var request = new HttpRequestMessage(HttpMethod.Get, "http://localhost/Products/Index");
request.Headers.Add("User", user);
// Act
@@ -43,7 +43,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
public async Task RouteWithAttributeRoute_IncludesLocale_BasedOnUser(string user, string expected)
{
// Arrange
- var request = new HttpRequestMessage(HttpMethod.Get, "http://localhost/CustomRoute_Orders/5");
+ var request = new HttpRequestMessage(HttpMethod.Get, "http://localhost/Orders/5");
request.Headers.Add("User", user);
// Act
diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/RazorFileSystemCaseSensitivityTest.cs b/test/Microsoft.AspNet.Mvc.FunctionalTests/EmbeddedViewSampleTest.cs
similarity index 53%
rename from test/Microsoft.AspNet.Mvc.FunctionalTests/RazorFileSystemCaseSensitivityTest.cs
rename to test/Microsoft.AspNet.Mvc.FunctionalTests/EmbeddedViewSampleTest.cs
index 9400628654..1a54b6456f 100644
--- a/test/Microsoft.AspNet.Mvc.FunctionalTests/RazorFileSystemCaseSensitivityTest.cs
+++ b/test/Microsoft.AspNet.Mvc.FunctionalTests/EmbeddedViewSampleTest.cs
@@ -7,11 +7,9 @@ using Xunit;
namespace Microsoft.AspNet.Mvc.FunctionalTests
{
- // The EmbeddedFileSystem used by RazorEmbeddedViewsWebSite performs case sensitive lookups for files.
- // These tests verify that we correctly normalize route values when constructing view lookup paths.
- public class RazorFileSystemCaseSensitivityTest : IClassFixture>
+ public class EmbeddedViewSampleTest : IClassFixture>
{
- public RazorFileSystemCaseSensitivityTest(MvcTestFixture fixture)
+ public EmbeddedViewSampleTest(MvcTestFixture fixture)
{
Client = fixture.Client;
}
@@ -19,13 +17,27 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
public HttpClient Client { get; }
[Fact]
- public async Task RazorViewEngine_NormalizesActionName_WhenLookingUpViewPaths()
+ public async Task RazorViewEngine_UsesFileProviderOnViewEngineOptionsToLocateViews()
{
// Arrange
- var expectedMessage = "Hello test-user, this is /RazorEmbeddedViews_Home";
+ var expectedMessage = "Hello test-user, this is /Home/EchoActionUrl";
// Act
- var response = await Client.GetStringAsync("http://localhost/RazorEmbeddedViews_Home/index?User=test-user");
+ var response = await Client.GetStringAsync("http://localhost/Home/EchoActionUrl?User=test-user");
+
+ // Assert
+ Assert.Equal(expectedMessage, response);
+ }
+
+ [Fact]
+ public async Task RazorViewEngine_UsesFileProviderOnViewEngineOptionsToLocateAreaViews()
+ {
+ // Arrange
+ var expectedMessage = "Hello admin-user, this is /Restricted/Admin/Login";
+ var target = "http://localhost/Restricted/Admin/Login?AdminUser=admin-user";
+
+ // Act
+ var response = await Client.GetStringAsync(target);
// Assert
Assert.Equal(expectedMessage, response);
@@ -35,10 +47,10 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
public async Task RazorViewEngine_NormalizesControllerRouteValue_WhenLookingUpViewPaths()
{
// Arrange
- var expectedMessage = "Hello test-user, this is /razorembeddedviews_home";
+ var expectedMessage = "Hello test-user, this is /home/echoactionurl";
// Act
- var response = await Client.GetStringAsync("http://localhost/razorembeddedviews_home?User=test-user");
+ var response = await Client.GetStringAsync("http://localhost/home/echoactionurl?User=test-user");
// Assert
Assert.Equal(expectedMessage, response);
@@ -48,8 +60,8 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
public async Task RazorViewEngine_NormalizesAreaRouteValue_WhenLookupViewPaths()
{
// Arrange
- var expectedMessage = "Hello admin-user, this is /restricted/razorembeddedviews_admin/login";
- var target = "http://localhost/restricted/razorembeddedviews_admin/login?AdminUser=admin-user";
+ var expectedMessage = "Hello admin-user, this is /restricted/admin/login";
+ var target = "http://localhost/restricted/admin/login?AdminUser=admin-user";
// Act
var response = await Client.GetStringAsync(target);
diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/FilteredDefaultAssemblyProviderFixtureOfT.cs b/test/Microsoft.AspNet.Mvc.FunctionalTests/FilteredDefaultAssemblyProviderFixtureOfT.cs
deleted file mode 100644
index d4ac0cb6e4..0000000000
--- a/test/Microsoft.AspNet.Mvc.FunctionalTests/FilteredDefaultAssemblyProviderFixtureOfT.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Microsoft.AspNet.Mvc.Infrastructure;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.PlatformAbstractions;
-
-namespace Microsoft.AspNet.Mvc.FunctionalTests
-{
- public class FilteredDefaultAssemblyProviderFixture : MvcTestFixture
- where TStartup : new()
- {
- protected override void AddAdditionalServices(IServiceCollection services)
- {
- // MvcTestFixture normally replaces the DefaultAssemblyProvider with an IAssemblyProvider
- // implementation that limits the set of candidate assemblies to the executing application. Switch it back
- // to using a filtered default assembly provider.
- services.AddTransient();
- }
-
- private class FilteredDefaultAssemblyProvider : DefaultAssemblyProvider
- {
- public FilteredDefaultAssemblyProvider(ILibraryManager libraryManager)
- : base(libraryManager)
- {
- }
-
- protected override IEnumerable GetCandidateLibraries()
- {
- var libraries = base.GetCandidateLibraries();
-
- // Filter out other WebSite projects
- return libraries.Where(library => !library.Name.Contains("WebSite") ||
- library.Name.Equals(nameof(ControllerDiscoveryConventionsWebSite), StringComparison.Ordinal));
- }
- }
- }
-}
diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/FormatFilterTest.cs b/test/Microsoft.AspNet.Mvc.FunctionalTests/FormatFilterSampleTest.cs
similarity index 93%
rename from test/Microsoft.AspNet.Mvc.FunctionalTests/FormatFilterTest.cs
rename to test/Microsoft.AspNet.Mvc.FunctionalTests/FormatFilterSampleTest.cs
index e9d166e035..6472cc4ca9 100644
--- a/test/Microsoft.AspNet.Mvc.FunctionalTests/FormatFilterTest.cs
+++ b/test/Microsoft.AspNet.Mvc.FunctionalTests/FormatFilterSampleTest.cs
@@ -8,9 +8,9 @@ using Xunit;
namespace Microsoft.AspNet.Mvc.FunctionalTests
{
- public class FormatFilterTest : IClassFixture>
+ public class FormatFilterSampleTest : IClassFixture>
{
- public FormatFilterTest(MvcTestFixture fixture)
+ public FormatFilterSampleTest(MvcTestFixture fixture)
{
Client = fixture.Client;
}
@@ -112,6 +112,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
// Assert
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
Assert.Equal(@"ProducesOverrideController", await response.Content.ReadAsStringAsync());
+ Assert.Equal("application/custom", response.Content.Headers.ContentType.MediaType);
}
}
}
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/InlineConstraintTests.cs b/test/Microsoft.AspNet.Mvc.FunctionalTests/InlineConstraintSampleTest.cs
similarity index 85%
rename from test/Microsoft.AspNet.Mvc.FunctionalTests/InlineConstraintTests.cs
rename to test/Microsoft.AspNet.Mvc.FunctionalTests/InlineConstraintSampleTest.cs
index 69cd67f780..d9db7ae22a 100644
--- a/test/Microsoft.AspNet.Mvc.FunctionalTests/InlineConstraintTests.cs
+++ b/test/Microsoft.AspNet.Mvc.FunctionalTests/InlineConstraintSampleTest.cs
@@ -11,9 +11,9 @@ using Xunit;
namespace Microsoft.AspNet.Mvc.FunctionalTests
{
- public class InlineConstraintTests : IClassFixture>
+ public class InlineConstraintSampleTest : IClassFixture>
{
- public InlineConstraintTests(MvcTestFixture fixture)
+ public InlineConstraintSampleTest(MvcTestFixture fixture)
{
Client = fixture.Client;
}
@@ -24,7 +24,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
public async Task RoutingToANonExistantArea_WithExistConstraint_RoutesToCorrectAction()
{
// Arrange & Act
- var response = await Client.GetAsync("http://localhost/area-exists/Users");
+ var response = await Client.GetAsync("http://localhost/constant-prefix/Users");
// Assert
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
@@ -32,24 +32,6 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
Assert.Equal("Users.Index", returnValue);
}
- [Fact]
- public async Task RoutingToANonExistantArea_WithoutExistConstraint_RoutesToIncorrectAction()
- {
- // Arrange & Act
- var response = await Client.GetAsync("http://localhost/area-withoutexists/Users");
-
- // Assert
- var exception = response.GetServerException();
- // Mono issue - https://github.com/aspnet/External/issues/19
- Assert.Equal(
- "The view 'Index' was not found." +
- " The following locations were searched:" + PlatformNormalizer.GetNewLinesAsUnderscores(1) +
- "/Areas/Users/Views/Home/Index.cshtml" + PlatformNormalizer.GetNewLinesAsUnderscores(1) +
- "/Areas/Users/Views/Shared/Index.cshtml" + PlatformNormalizer.GetNewLinesAsUnderscores(1) +
- "/Views/Shared/Index.cshtml",
- exception.ExceptionMessage);
- }
-
[Fact]
public async Task GetProductById_IntConstraintForOptionalId_IdPresent()
{
@@ -61,7 +43,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
var result = await GetResponseValues(response);
Assert.Equal(result["id"], "5");
- Assert.Equal(result["controller"], "InlineConstraints_Products");
+ Assert.Equal(result["controller"], "Products");
Assert.Equal(result["action"], "GetProductById");
}
@@ -74,7 +56,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
// Assert
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
var result = await GetResponseValues(response);
- Assert.Equal(result["controller"], "InlineConstraints_Products");
+ Assert.Equal(result["controller"], "Products");
Assert.Equal(result["action"], "GetProductById");
}
@@ -98,7 +80,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
var result = await GetResponseValues(response);
Assert.Equal(result["name"], "asdf");
- Assert.Equal(result["controller"], "InlineConstraints_Products");
+ Assert.Equal(result["controller"], "Products");
Assert.Equal(result["action"], "GetProductByName");
}
@@ -134,7 +116,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
var result = await GetResponseValues(response);
Assert.Equal(result["dateTime"], new DateTime(2014, 10, 11, 13, 45, 30));
- Assert.Equal(result["controller"], "InlineConstraints_Products");
+ Assert.Equal(result["controller"], "Products");
Assert.Equal(result["action"], "GetProductByManufacturingDate");
}
@@ -148,7 +130,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
var result = await GetResponseValues(response);
Assert.Equal(result["name"], "Sports");
- Assert.Equal(result["controller"], "InlineConstraints_Products");
+ Assert.Equal(result["controller"], "Products");
Assert.Equal(result["action"], "GetProductByCategoryName");
}
@@ -172,7 +154,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
// Assert
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
var result = await GetResponseValues(response);
- Assert.Equal(result["controller"], "InlineConstraints_Products");
+ Assert.Equal(result["controller"], "Products");
Assert.Equal(result["action"], "GetProductByCategoryName");
}
@@ -186,7 +168,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
var result = await GetResponseValues(response);
Assert.Equal(result["catId"], "40");
- Assert.Equal(result["controller"], "InlineConstraints_Products");
+ Assert.Equal(result["controller"], "Products");
Assert.Equal(result["action"], "GetProductByCategoryId");
}
@@ -220,7 +202,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
var result = await GetResponseValues(response);
Assert.Equal(result["price"], "4023.23423");
- Assert.Equal(result["controller"], "InlineConstraints_Products");
+ Assert.Equal(result["controller"], "Products");
Assert.Equal(result["action"], "GetProductByPrice");
}
@@ -233,7 +215,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
// Assert
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
var result = await GetResponseValues(response);
- Assert.Equal(result["controller"], "InlineConstraints_Products");
+ Assert.Equal(result["controller"], "Products");
Assert.Equal(result["action"], "GetProductByPrice");
}
@@ -247,7 +229,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
var result = await GetResponseValues(response);
Assert.Equal(result["manId"], "57");
- Assert.Equal(result["controller"], "InlineConstraints_Products");
+ Assert.Equal(result["controller"], "Products");
Assert.Equal(result["action"], "GetProductByManufacturerId");
}
@@ -260,7 +242,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
// Assert
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
var result = await GetResponseValues(response);
- Assert.Equal(result["controller"], "InlineConstraints_Products");
+ Assert.Equal(result["controller"], "Products");
Assert.Equal(result["action"], "GetProductByManufacturerId");
}
@@ -273,7 +255,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
// Assert
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
var result = await GetResponseValues(response);
- Assert.Equal(result["controller"], "InlineConstraints_Products");
+ Assert.Equal(result["controller"], "Products");
Assert.Equal(result["action"], "GetUserByName");
Assert.Equal(result["name"], "abc");
}
@@ -299,7 +281,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
var result = await GetResponseValues(response);
Assert.Equal(result["id"], "691cf17a-791b-4af8-99fd-e739e168170f");
- Assert.Equal(result["controller"], "InlineConstraints_Store");
+ Assert.Equal(result["controller"], "Store");
Assert.Equal(result["action"], "GetStoreById");
}
@@ -312,7 +294,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
// Assert
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
var result = await GetResponseValues(response);
- Assert.Equal(result["controller"], "InlineConstraints_Store");
+ Assert.Equal(result["controller"], "Store");
Assert.Equal(result["action"], "GetStoreById");
}
@@ -336,7 +318,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
var result = await GetResponseValues(response);
Assert.Equal(result["location"], "Bellevue");
- Assert.Equal(result["controller"], "InlineConstraints_Store");
+ Assert.Equal(result["controller"], "Store");
Assert.Equal(result["action"], "GetStoreByLocation");
}
@@ -395,7 +377,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
// Attribute Route, id:int? constraint
yield return new object[]
{
- "InlineConstraints_Products",
+ "Products",
"GetProductById",
"id",
"5",
@@ -405,17 +387,17 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
// Attribute Route, id:int? constraint
yield return new object[]
{
- "InlineConstraints_Products",
+ "Products",
"GetProductById",
"id",
"sdsd",
- "/area-exists/InlineConstraints_Products/GetProductById?id=sdsd"
+ string.Empty // Link generation expected to fail.
};
// Attribute Route, name:alpha constraint
yield return new object[]
{
- "InlineConstraints_Products",
+ "Products",
"GetProductByName",
"name",
"zxcv",
@@ -425,7 +407,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
// Attribute Route, name:length(1,20)? constraint
yield return new object[]
{
- "InlineConstraints_Products",
+ "Products",
"GetProductByCategoryName",
"name",
"sports",
@@ -435,7 +417,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
// Attribute Route, name:length(1,20)? constraint
yield return new object[]
{
- "InlineConstraints_Products",
+ "Products",
"GetProductByCategoryName",
null,
null,
@@ -445,7 +427,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
// Attribute Route, catId:int:range(10, 100) constraint
yield return new object[]
{
- "InlineConstraints_Products",
+ "Products",
"GetProductByCategoryId",
"catId",
"50",
@@ -455,17 +437,17 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
// Attribute Route, catId:int:range(10, 100) constraint
yield return new object[]
{
- "InlineConstraints_Products",
+ "Products",
"GetProductByCategoryId",
"catId",
"500",
- "/area-exists/InlineConstraints_Products/GetProductByCategoryId?catId=500"
+ string.Empty // Link generation expected to fail.
};
// Attribute Route, name:length(1,20)? constraint
yield return new object[]
{
- "InlineConstraints_Products",
+ "Products",
"GetProductByPrice",
"price",
"123.45",
@@ -475,7 +457,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
// Attribute Route, price:float? constraint
yield return new object[]
{
- "InlineConstraints_Products",
+ "Products",
"GetProductByManufacturerId",
"manId",
"15",
@@ -485,27 +467,27 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
// Attribute Route, manId:int:min(10)? constraint
yield return new object[]
{
- "InlineConstraints_Products",
+ "Products",
"GetProductByManufacturerId",
"manId",
"qwer",
- "/area-exists/InlineConstraints_Products/GetProductByManufacturerId?manId=qwer"
+ string.Empty // Link generation expected to fail.
};
// Attribute Route, manId:int:min(10)? constraint
yield return new object[]
{
- "InlineConstraints_Products",
+ "Products",
"GetProductByManufacturerId",
"manId",
"1",
- "/area-exists/InlineConstraints_Products/GetProductByManufacturerId?manId=1"
+ string.Empty // Link generation expected to fail.
};
// Attribute Route, dateTime:datetime constraint
yield return new object[]
{
- "InlineConstraints_Products",
+ "Products",
"GetProductByManufacturingDate",
"dateTime",
"2014-10-11T13:45:30",
@@ -515,7 +497,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
// Conventional Route, id:guid? constraint
yield return new object[]
{
- "InlineConstraints_Store",
+ "Store",
"GetStoreById",
"id",
"691cf17a-791b-4af8-99fd-e739e168170f",
diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/JsonPatchTest.cs b/test/Microsoft.AspNet.Mvc.FunctionalTests/JsonPatchSampleTest.cs
similarity index 98%
rename from test/Microsoft.AspNet.Mvc.FunctionalTests/JsonPatchTest.cs
rename to test/Microsoft.AspNet.Mvc.FunctionalTests/JsonPatchSampleTest.cs
index 5a02b5dfd0..ef4774f6f3 100644
--- a/test/Microsoft.AspNet.Mvc.FunctionalTests/JsonPatchTest.cs
+++ b/test/Microsoft.AspNet.Mvc.FunctionalTests/JsonPatchSampleTest.cs
@@ -6,16 +6,16 @@ using System.Collections.Generic;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
-using JsonPatchWebSite.Models;
+using JsonPatchSample.Web.Models;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Xunit;
namespace Microsoft.AspNet.Mvc.FunctionalTests
{
- public class JsonPatchTest : IClassFixture>
+ public class JsonPatchSampleTest : IClassFixture>
{
- public JsonPatchTest(MvcTestFixture fixture)
+ public JsonPatchSampleTest(MvcTestFixture fixture)
{
Client = fixture.Client;
}
diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/LocalizationTest.cs b/test/Microsoft.AspNet.Mvc.FunctionalTests/LocalizationSampleTest.cs
similarity index 93%
rename from test/Microsoft.AspNet.Mvc.FunctionalTests/LocalizationTest.cs
rename to test/Microsoft.AspNet.Mvc.FunctionalTests/LocalizationSampleTest.cs
index 7fb57e680b..35e1397342 100644
--- a/test/Microsoft.AspNet.Mvc.FunctionalTests/LocalizationTest.cs
+++ b/test/Microsoft.AspNet.Mvc.FunctionalTests/LocalizationSampleTest.cs
@@ -4,7 +4,6 @@
using System;
using System.Collections.Generic;
using System.Net.Http;
-using System.Reflection;
using System.Threading.Tasks;
using Microsoft.AspNet.Testing;
using Microsoft.Net.Http.Headers;
@@ -12,12 +11,9 @@ using Xunit;
namespace Microsoft.AspNet.Mvc.FunctionalTests
{
- public class LocalizationTest : IClassFixture>
+ public class LocalizationSampleTest : IClassFixture>
{
- private const string SiteName = nameof(LocalizationWebSite);
- private static readonly Assembly _assembly = typeof(LocalizationTest).GetTypeInfo().Assembly;
-
- public LocalizationTest(MvcTestFixture fixture)
+ public LocalizationSampleTest(MvcTestFixture fixture)
{
Client = fixture.Client;
}
diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/Logging/LoggingAssert.cs b/test/Microsoft.AspNet.Mvc.FunctionalTests/Logging/LoggingAssert.cs
deleted file mode 100644
index 5cf102f5b4..0000000000
--- a/test/Microsoft.AspNet.Mvc.FunctionalTests/Logging/LoggingAssert.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-using System;
-using System.Collections.Generic;
-using LoggingWebSite;
-using Xunit.Sdk;
-
-namespace Microsoft.AspNet.Mvc.FunctionalTests
-{
- public static class LoggingAssert
- {
- ///
- /// Compares two trees and verifies if the scope nodes are equal
- ///
- ///
- ///
- ///
- public static bool ScopesEqual(ScopeNodeDto expected, ScopeNodeDto actual)
- {
- // To enable diagnosis, here a flat-list(pe-order traversal based) of
- // these trees is provided.
- if (!AreScopesEqual(expected, actual))
- {
- var expectedScopes = new List();
- var actualScopes = new List();
-
- TraverseScopeTree(expected, expectedScopes);
- TraverseScopeTree(actual, actualScopes);
-
- throw new EqualException(expected: string.Join(", ", expectedScopes),
- actual: string.Join(", ", actualScopes));
- }
-
- return true;
- }
-
- ///
- /// Compares two trees and verifies if the scope nodes are equal
- ///
- ///
- ///
- ///
- private static bool AreScopesEqual(ScopeNodeDto root1, ScopeNodeDto root2)
- {
- if (root1 == null && root2 == null)
- {
- return true;
- }
-
- if (root1 == null || root2 == null)
- {
- return false;
- }
-
- if (!string.Equals(root1.State?.ToString(), root2.State?.ToString(), StringComparison.OrdinalIgnoreCase)
- || root1.Children.Count != root2.Children.Count)
- {
- return false;
- }
-
- bool isChildScopeEqual = true;
- for (int i = 0; i < root1.Children.Count; i++)
- {
- isChildScopeEqual = AreScopesEqual(root1.Children[i], root2.Children[i]);
-
- if (!isChildScopeEqual)
- {
- break;
- }
- }
-
- return isChildScopeEqual;
- }
-
- ///
- /// Traverses the scope node sub-tree and collects the list scopes
- ///
- ///
- ///
- private static void TraverseScopeTree(ScopeNodeDto root, List scopes)
- {
- if (root == null)
- {
- return;
- }
-
- scopes.Add(root.State?.ToString());
-
- foreach (var childScope in root.Children)
- {
- TraverseScopeTree(childScope, scopes);
- }
- }
- }
-}
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/Logging/LoggingExtensions.cs b/test/Microsoft.AspNet.Mvc.FunctionalTests/Logging/LoggingExtensions.cs
deleted file mode 100644
index d2bff9551d..0000000000
--- a/test/Microsoft.AspNet.Mvc.FunctionalTests/Logging/LoggingExtensions.cs
+++ /dev/null
@@ -1,161 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using LoggingWebSite;
-using Microsoft.AspNet.WebUtilities;
-
-namespace Microsoft.AspNet.Mvc.FunctionalTests
-{
- public static class LoggingExtensions
- {
- public const string RequestTraceIdQueryKey = "RequestTraceId";
-
- ///
- /// Gets a scope node with the given name
- ///
- ///
- ///
- /// A scope node if found, else null
- public static ScopeNodeDto FindScope(this IEnumerable activities,
- string scopeName)
- {
- ScopeNodeDto node = null;
-
- foreach (var activity in activities)
- {
- if (activity.RepresentsScope)
- {
- node = GetScope(activity.Root, scopeName);
-
- // Ideally we do not expect multiple scopes with the same name
- // to exist in the logs, so we break on the first found scope node.
- // Note: The logs can contain multiple scopes with the same name across
- // different requests, but the tests are expected to filter the logs by request
- // (ex: using request trace id) and then find the scope by name.
- if (node != null)
- {
- return node;
- }
- }
- }
-
- return node;
- }
-
- ///
- /// Gets all the logs messages matching the given data type
- ///
- ///
- ///
- public static IEnumerable GetLogsByDataType(this IEnumerable activities)
- {
- var logInfos = new List();
- foreach (var activity in activities)
- {
- if (!activity.RepresentsScope)
- {
- var logInfo = activity.Root.Messages.OfDataType()
- .FirstOrDefault();
-
- if (logInfo != null)
- {
- logInfos.Add(logInfo);
- }
- }
- else
- {
- GetLogsByDataType(activity.Root, logInfos);
- }
- }
-
- return logInfos;
- }
-
- ///
- /// Filters for logs activties created during application startup
- ///
- ///
- ///
- public static IEnumerable FilterByStartup(this IEnumerable activities)
- {
- return activities.Where(activity => activity.RequestInfo == null);
- }
-
- ///
- /// Filters log activities based on the given request.
- ///
- ///
- /// The "RequestTraceId" query parameter value
- ///
- public static IEnumerable FilterByRequestTraceId(this IEnumerable activities,
- string requestTraceId)
- {
- return activities.Where(activity => activity.RequestInfo != null
- && string.Equals(GetQueryValue(activity.RequestInfo.Query, RequestTraceIdQueryKey),
- requestTraceId,
- StringComparison.OrdinalIgnoreCase));
- }
-
- ///
- /// Filters the log messages based on the given data type
- ///
- ///
- ///
- public static IEnumerable OfDataType(this IEnumerable logInfos)
- {
- return logInfos.Where(logInfo => logInfo.StateType != null
- && logInfo.StateType.Equals(typeof(T)));
- }
-
- ///
- /// Traverses through the log node tree and gets the log messages whose StateType
- /// matches the supplied data type.
- ///
- ///
- ///
- private static void GetLogsByDataType(ScopeNodeDto node, IList logInfoDtos)
- {
- foreach (var logInfo in node.Messages.OfDataType())
- {
- logInfoDtos.Add(logInfo);
- }
-
- foreach (var scopeNode in node.Children)
- {
- GetLogsByDataType(scopeNode, logInfoDtos);
- }
- }
-
- private static ScopeNodeDto GetScope(ScopeNodeDto root, string scopeName)
- {
- if (string.Equals(root.State?.ToString(),
- scopeName,
- StringComparison.OrdinalIgnoreCase))
- {
- return root;
- }
-
- foreach (var childNode in root.Children)
- {
- var foundNode = GetScope(childNode, scopeName);
-
- if (foundNode != null)
- {
- return foundNode;
- }
- }
-
- return null;
- }
-
- private static string GetQueryValue(string query, string key)
- {
- var queryString = QueryHelpers.ParseQuery(query);
-
- return queryString[key].FirstOrDefault();
- }
- }
-}
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/ModelBindingBindingBehaviorTest.cs b/test/Microsoft.AspNet.Mvc.FunctionalTests/ModelBindingBindingBehaviorTest.cs
deleted file mode 100644
index d17261123c..0000000000
--- a/test/Microsoft.AspNet.Mvc.FunctionalTests/ModelBindingBindingBehaviorTest.cs
+++ /dev/null
@@ -1,123 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-using System.Collections.Generic;
-using System.Net;
-using System.Net.Http;
-using System.Threading.Tasks;
-using ModelBindingWebSite;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using Xunit;
-
-namespace Microsoft.AspNet.Mvc.FunctionalTests
-{
- public class ModelBindingBindingBehaviorTest : IClassFixture>
- {
- public ModelBindingBindingBehaviorTest(MvcTestFixture fixture)
- {
- Client = fixture.Client;
- }
-
- public HttpClient Client { get; }
-
- [Fact]
- public async Task BindingBehavior_MissingRequiredProperties_ValidationErrors()
- {
- // Arrange
- var url = "http://localhost/BindingBehavior/EchoModelValues";
- var request = new HttpRequestMessage(HttpMethod.Post, url);
- var formData = new List>
- {
- new KeyValuePair("model.BehaviourOptionalProperty", "Hi"),
- };
-
- request.Content = new FormUrlEncodedContent(formData);
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
-
- var body = await response.Content.ReadAsStringAsync();
- var errors = JsonConvert.DeserializeObject(body);
-
- Assert.Equal(2, errors.Count);
-
- var error = Assert.Single(errors, kvp => kvp.Key == "model.BehaviourRequiredProperty");
- Assert.Equal(
- "A value for the 'BehaviourRequiredProperty' property was not provided.",
- ((JArray)error.Value)[0].Value());
-
- error = Assert.Single(errors, kvp => kvp.Key == "model.BindRequiredProperty");
- Assert.Equal(
- "A value for the 'BindRequiredProperty' property was not provided.",
- ((JArray)error.Value)[0].Value());
- }
-
- [Fact]
- public async Task BindingBehavior_OptionalIsOptional()
- {
- // Arrange
- var url = "http://localhost/BindingBehavior/EchoModelValues";
- var request = new HttpRequestMessage(HttpMethod.Post, url);
- var formData = new List>
- {
- new KeyValuePair("model.BehaviourRequiredProperty", "Hello"),
- new KeyValuePair("model.BindRequiredProperty", "World!"),
- };
-
- request.Content = new FormUrlEncodedContent(formData);
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
-
- var body = await response.Content.ReadAsStringAsync();
- var model = JsonConvert.DeserializeObject(body);
-
- Assert.Null(model.BehaviourNeverProperty);
- Assert.Null(model.BehaviourOptionalProperty);
- Assert.Equal("Hello", model.BehaviourRequiredProperty);
- Assert.Equal("World!", model.BindRequiredProperty);
- Assert.Null(model.BindNeverProperty);
- }
-
- [Fact]
- public async Task BindingBehavior_Never_IsNotBound()
- {
- // Arrange
- var url = "http://localhost/BindingBehavior/EchoModelValues";
- var request = new HttpRequestMessage(HttpMethod.Post, url);
- var formData = new List>
- {
-
- new KeyValuePair("model.BehaviourNeverProperty", "Ignored"),
- new KeyValuePair("model.BehaviourOptionalProperty", "Optional"),
- new KeyValuePair("model.BehaviourRequiredProperty", "Hello"),
- new KeyValuePair("model.BindRequiredProperty", "World!"),
- new KeyValuePair("model.BindNeverProperty", "Ignored"),
- };
-
- request.Content = new FormUrlEncodedContent(formData);
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
-
- var body = await response.Content.ReadAsStringAsync();
- var model = JsonConvert.DeserializeObject(body);
-
- Assert.Null(model.BehaviourNeverProperty);
- Assert.Equal("Optional", model.BehaviourOptionalProperty);
- Assert.Equal("Hello", model.BehaviourRequiredProperty);
- Assert.Equal("World!", model.BindRequiredProperty);
- Assert.Null(model.BindNeverProperty);
- }
- }
-}
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/ModelBindingDataMemberRequiredTest.cs b/test/Microsoft.AspNet.Mvc.FunctionalTests/ModelBindingDataMemberRequiredTest.cs
deleted file mode 100644
index 9c86b2dd04..0000000000
--- a/test/Microsoft.AspNet.Mvc.FunctionalTests/ModelBindingDataMemberRequiredTest.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-using System.Collections.Generic;
-using System.Net;
-using System.Net.Http;
-using System.Threading.Tasks;
-using ModelBindingWebSite;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using Xunit;
-
-namespace Microsoft.AspNet.Mvc.FunctionalTests
-{
- public class ModelBindingDataMemberRequiredTest : IClassFixture>
- {
- public ModelBindingDataMemberRequiredTest(MvcTestFixture fixture)
- {
- Client = fixture.Client;
- }
-
- public HttpClient Client { get; }
-
- [Fact]
- public async Task DataMember_MissingRequiredProperty_ValidationError()
- {
- // Arrange
- var url = "http://localhost/DataMemberRequired/EchoModelValues";
- var request = new HttpRequestMessage(HttpMethod.Post, url);
- var formData = new List>
- {
- new KeyValuePair("model.ExplicitlyOptionalProperty", "Hi"),
- };
-
- request.Content = new FormUrlEncodedContent(formData);
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
-
- var body = await response.Content.ReadAsStringAsync();
- var errors = JsonConvert.DeserializeObject(body);
-
- Assert.Equal(1, errors.Count);
-
- var error = Assert.Single(errors, kvp => kvp.Key == "model.RequiredProperty");
- Assert.Equal(
- "A value for the 'RequiredProperty' property was not provided.",
- ((JArray)error.Value)[0].Value());
- }
-
- [Fact]
- public async Task DataMember_RequiredPropertyProvided_Success()
- {
- // Arrange
- var url = "http://localhost/DataMemberRequired/EchoModelValues";
- var request = new HttpRequestMessage(HttpMethod.Post, url);
- var formData = new List>
- {
- new KeyValuePair("model.ImplicitlyOptionalProperty", "Hello"),
- new KeyValuePair("model.ExplicitlyOptionalProperty", "World!"),
- new KeyValuePair("model.RequiredProperty", "Required!"),
- };
-
- request.Content = new FormUrlEncodedContent(formData);
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
-
- var body = await response.Content.ReadAsStringAsync();
- var model = JsonConvert.DeserializeObject(body);
-
- Assert.Equal("Hello", model.ImplicitlyOptionalProperty);
- Assert.Equal("World!", model.ExplicitlyOptionalProperty);
- Assert.Equal("Required!", model.RequiredProperty);
- }
- }
-}
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/ModelBindingFromFormTest.cs b/test/Microsoft.AspNet.Mvc.FunctionalTests/ModelBindingFromFormTest.cs
deleted file mode 100644
index a36ee72987..0000000000
--- a/test/Microsoft.AspNet.Mvc.FunctionalTests/ModelBindingFromFormTest.cs
+++ /dev/null
@@ -1,141 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-using System.Collections.Generic;
-using System.Net.Http;
-using System.Threading.Tasks;
-using ModelBindingWebSite;
-using ModelBindingWebSite.Controllers;
-using ModelBindingWebSite.Models;
-using Newtonsoft.Json;
-using Xunit;
-
-namespace Microsoft.AspNet.Mvc.FunctionalTests
-{
- public class ModelBindingFromFormTest : IClassFixture>
- {
- public ModelBindingFromFormTest(MvcTestFixture fixture)
- {
- Client = fixture.Client;
- }
-
- public HttpClient Client { get; }
-
- [Fact]
- public async Task FromForm_CustomModelPrefix_ForParameter()
- {
- // Arrange
- var url = "http://localhost/FromFormAttribute_Company/CreateCompany";
- var request = new HttpRequestMessage(HttpMethod.Post, url);
- var nameValueCollection = new List>
- {
- new KeyValuePair("customPrefix.Employees[0].Name", "somename"),
- };
-
- request.Content = new FormUrlEncodedContent(nameValueCollection);
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- var body = await response.Content.ReadAsStringAsync();
- var company = JsonConvert.DeserializeObject(body);
-
- var employee = Assert.Single(company.Employees);
-
- Assert.Equal("somename", employee.Name);
- }
-
- [Fact]
- public async Task FromForm_CustomModelPrefix_ForCollectionParameter()
- {
- // Arrange
- var url = "http://localhost/FromFormAttribute_Company/CreateCompanyFromEmployees";
- var request = new HttpRequestMessage(HttpMethod.Post, url);
- var nameValueCollection = new List>
- {
- new KeyValuePair("customPrefix[0].Department", "Contoso"),
- };
- request.Content = new FormUrlEncodedContent(nameValueCollection);
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- var body = await response.Content.ReadAsStringAsync();
- var company = JsonConvert.DeserializeObject(body);
-
- var employee = Assert.Single(company.Employees);
- Assert.Equal("Contoso", employee.Department);
- }
-
- [Fact]
- public async Task FromForm_CustomModelPrefix_ForProperty()
- {
- // Arrange
- var url = "http://localhost/FromFormAttribute_Company/CreateCompany";
- var request = new HttpRequestMessage(HttpMethod.Post, url);
- var nameValueCollection = new List>
- {
- new KeyValuePair("customPrefix.Employees[0].EmployeeSSN", "123132131"),
- };
- request.Content = new FormUrlEncodedContent(nameValueCollection);
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- var body = await response.Content.ReadAsStringAsync();
- var company = JsonConvert.DeserializeObject(body);
-
- var employee = Assert.Single(company.Employees);
- Assert.Equal("123132131", employee.SSN);
- }
-
- [Fact]
- public async Task FromForm_CustomModelPrefix_ForCollectionProperty()
- {
- // Arrange
- var url = "http://localhost/FromFormAttribute_Company/CreateDepartment";
- var request = new HttpRequestMessage(HttpMethod.Post, url);
- var nameValueCollection = new List>
- {
- new KeyValuePair("department.TestEmployees[0].EmployeeSSN", "123132131"),
- };
- request.Content = new FormUrlEncodedContent(nameValueCollection);
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- var body = await response.Content.ReadAsStringAsync();
- var department = JsonConvert.DeserializeObject<
- FromFormAttribute_CompanyController.FromForm_Department>(body);
-
- var employee = Assert.Single(department.Employees);
- Assert.Equal("123132131", employee.SSN);
- }
-
- [Fact]
- public async Task FromForm_NonExistingValueAddsValidationErrors_OnProperty_UsingCustomModelPrefix()
- {
- // Arrange
- var url = "http://localhost/FromFormAttribute_Company/ValidateDepartment";
- var request = new HttpRequestMessage(HttpMethod.Post, url);
-
- // No values.
- var nameValueCollection = new List>();
- request.Content = new FormUrlEncodedContent(nameValueCollection);
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- var body = await response.Content.ReadAsStringAsync();
- var result = JsonConvert.DeserializeObject(body);
- Assert.Null(result.Value);
- var error = Assert.Single(result.ModelStateErrors);
- Assert.Equal("TestEmployees", error);
- }
- }
-}
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/ModelBindingFromHeaderTest.cs b/test/Microsoft.AspNet.Mvc.FunctionalTests/ModelBindingFromHeaderTest.cs
deleted file mode 100644
index 966173e410..0000000000
--- a/test/Microsoft.AspNet.Mvc.FunctionalTests/ModelBindingFromHeaderTest.cs
+++ /dev/null
@@ -1,296 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-using System;
-using System.Net;
-using System.Net.Http;
-using System.Threading.Tasks;
-using Microsoft.AspNet.Builder;
-using Microsoft.Extensions.DependencyInjection;
-using Newtonsoft.Json;
-using Xunit;
-
-namespace Microsoft.AspNet.Mvc.FunctionalTests
-{
- public class ModelBindingFromHeaderTest : IClassFixture>
- {
- public ModelBindingFromHeaderTest(MvcTestFixture fixture)
- {
- Client = fixture.Client;
- }
-
- public HttpClient Client { get; }
-
- // The action that this test hits will echo back the model-bound value
- [Theory]
- [InlineData("transactionId", "1e331f25-0869-4c87-8a94-64e6e40cb5a0")]
- [InlineData("TransaCtionId", "1e331f25-0869-4c87-8a94-64e6e40cb5a0")] // Case-Insensitive
- [InlineData("TransaCtionId", "1e331f25-0869-4c87-8a94-64e6e40cb5a0,abcd")] // Binding to string doesn't split values
- public async Task FromHeader_BindHeader_ToString_OnParameter(string headerName, string headerValue)
- {
- // Arrange
- var expected = headerValue;
- var request = new HttpRequestMessage(HttpMethod.Get, "http://localhost/Blog/BindToStringParameter");
- request.Headers.TryAddWithoutValidation(headerName, headerValue);
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
-
- var body = await response.Content.ReadAsStringAsync();
- var result = JsonConvert.DeserializeObject(body);
- Assert.Equal(expected, result.HeaderValue);
- }
-
- [Fact]
- public async Task FromHeader_BindHeader_ToString_OnProperty_CustomName()
- {
- // Arrange
- var title = "How to make really really good soup.";
- var tags = new string[] { "Cooking", "Recipes", "Awesome" };
- var request = new HttpRequestMessage(HttpMethod.Get, "http://localhost/Blog/BindToProperty/CustomName");
- request.Headers.TryAddWithoutValidation("BlogTitle", title);
- request.Headers.TryAddWithoutValidation("BlogTags", string.Join(", ", tags));
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
-
- var body = await response.Content.ReadAsStringAsync();
- var result = JsonConvert.DeserializeObject(body);
- Assert.Equal(title, result.HeaderValue);
- Assert.Equal(tags, result.HeaderValues);
- Assert.Empty(result.ModelStateErrors);
- }
-
- [Fact]
- public async Task FromHeader_NonExistingHeaderAddsValidationErrors_OnProperty_CustomName()
- {
- // Arrange
- var tags = new string[] { "Cooking", "Recipes", "Awesome" };
- var request = new HttpRequestMessage(HttpMethod.Get, "http://localhost/Blog/BindToProperty/CustomName");
- request.Headers.TryAddWithoutValidation("BlogTags", string.Join(", ", tags));
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
-
- var body = await response.Content.ReadAsStringAsync();
- var result = JsonConvert.DeserializeObject(body);
- Assert.Equal(tags, result.HeaderValues);
- var error = Assert.Single(result.ModelStateErrors);
- Assert.Equal("BlogTitle", error);
- }
-
- [Fact]
- public async Task FromHeader_NonExistingHeaderAddsValidationErrors_OnCollectionProperty_CustomName()
- {
- // Arrange
- var request = new HttpRequestMessage(HttpMethod.Get, "http://localhost/Blog/BindToProperty/CustomName");
- request.Headers.TryAddWithoutValidation("BlogTitle", "Cooking Receipes.");
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
-
- var body = await response.Content.ReadAsStringAsync();
- var result = JsonConvert.DeserializeObject(body);
- Assert.Equal("Cooking Receipes.", result.HeaderValue);
- var error = Assert.Single(result.ModelStateErrors);
- Assert.Equal("BlogTags", error);
- }
-
- // The action that this test hits will echo back the model-bound value
- [Fact]
- public async Task FromHeader_BindHeader_ToString_OnParameter_CustomName()
- {
- // Arrange
- var expected = "1e331f25-0869-4c87-8a94-64e6e40cb5a0";
- var request = new HttpRequestMessage(HttpMethod.Get, "http://localhost/Blog/BindToStringParameter/CustomName");
- request.Headers.TryAddWithoutValidation("tId", "1e331f25-0869-4c87-8a94-64e6e40cb5a0");
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
-
- var body = await response.Content.ReadAsStringAsync();
- var result = JsonConvert.DeserializeObject(body);
-
- Assert.Equal(expected, result.HeaderValue);
- Assert.Null(result.HeaderValues);
- Assert.Empty(result.ModelStateErrors);
- }
-
- // There should be no model state error for a top-level object
- [Theory]
- [InlineData("transactionId1234", "1e331f25-0869-4c87-8a94-64e6e40cb5a0")]
- public async Task FromHeader_BindHeader_ToString_OnParameter_NoValues(string headerName, string headerValue)
- {
- // Arrange
- var expected = headerValue;
- var request = new HttpRequestMessage(HttpMethod.Get, "http://localhost/Blog/BindToStringParameter");
- request.Headers.TryAddWithoutValidation(headerName, headerValue);
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
-
- var body = await response.Content.ReadAsStringAsync();
- var result = JsonConvert.DeserializeObject(body);
-
- Assert.Null(result.HeaderValue);
- Assert.Null(result.HeaderValues);
- Assert.Empty(result.ModelStateErrors);
- }
-
- // There should be no model state error for a top-level object
- [Theory]
- [InlineData("transactionId1234", "1e331f25-0869-4c87-8a94-64e6e40cb5a0")]
- public async Task FromHeader_BindHeader_ToString_OnParameter_NoValues_DefaultValue(
- string headerName,
- string headerValue)
- {
- // Arrange
- // Intentionally not setting a header value
- var request = new HttpRequestMessage(
- HttpMethod.Get,
- "http://localhost/Blog/BindToStringParameterDefaultValue");
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
-
- var body = await response.Content.ReadAsStringAsync();
- var result = JsonConvert.DeserializeObject(body);
-
- Assert.Equal("default-value", result.HeaderValue);
- Assert.Null(result.HeaderValues);
- Assert.Empty(result.ModelStateErrors);
- }
-
- // The action that this test hits will echo back the model-bound values
- [Theory]
- [InlineData("transactionIds", "1e331f25-0869-4c87-8a94-64e6e40cb5a0")]
- [InlineData("transactionIds", "1e331f25-0869-4c87-8a94-64e6e40cb5a0,abcd,efg")]
- public async Task FromHeader_BindHeader_ToStringArray_OnParameter(string headerName, string headerValue)
- {
- // Arrange
- var expected = headerValue.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
- var request = new HttpRequestMessage(HttpMethod.Get, "http://localhost/Blog/BindToStringArrayParameter");
- request.Headers.TryAddWithoutValidation(headerName, headerValue);
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
-
- var body = await response.Content.ReadAsStringAsync();
- var result = JsonConvert.DeserializeObject(body);
-
- Assert.Null(result.HeaderValue);
- Assert.Equal(expected, result.HeaderValues);
- Assert.Empty(result.ModelStateErrors);
- }
-
- // The action that this test hits will echo back the model-bound values
- [Fact]
- public async Task FromHeader_BindHeader_ToModel()
- {
- // Arrange
- var title = "How to make really really good soup.";
- var tags = new string[] { "Cooking", "Recipes", "Awesome" };
- var request = new HttpRequestMessage(HttpMethod.Get, "http://localhost/Blog/BindToModel?author=Marvin");
- request.Headers.TryAddWithoutValidation("title", title);
- request.Headers.TryAddWithoutValidation("tags", string.Join(", ", tags));
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
-
- var body = await response.Content.ReadAsStringAsync();
- var result = JsonConvert.DeserializeObject(body);
-
- Assert.Equal(title, result.HeaderValue);
- Assert.Equal(tags, result.HeaderValues);
- Assert.Empty(result.ModelStateErrors);
- }
-
- // Title on the model has [Required] so it will have a validation error
- // Tags does not, so no error.
- [Fact]
- public async Task FromHeader_BindHeader_ToModel_NoValues_ValidationError()
- {
- // Arrange
- // Intentionally not setting a title or tags
- var request = new HttpRequestMessage(HttpMethod.Get, "http://localhost/Blog/BindToModel?author=Marvin");
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
-
- var body = await response.Content.ReadAsStringAsync();
- var result = JsonConvert.DeserializeObject(body);
-
- Assert.Null(result.HeaderValue);
- Assert.Null(result.HeaderValues);
-
- var error = Assert.Single(result.ModelStateErrors);
- Assert.Equal("Title", error);
- }
-
- // This model sets a value for 'Title', and the model binder won't trounce it.
- //
- // There's no validation error because we validate the value on the model.
- [Fact]
- public async Task FromHeader_BindHeader_ToModel_NoValues_InitializedValue_NoValidationError()
- {
- // Arrange
- // Intentionally not setting a title or tags
- var request = new HttpRequestMessage(
- HttpMethod.Get,
- "http://localhost/Blog/BindToModelWithInitializedValue?author=Marvin");
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
-
- var body = await response.Content.ReadAsStringAsync();
- var result = JsonConvert.DeserializeObject(body);
-
- Assert.Equal("How to Make Soup", result.HeaderValue);
- Assert.Equal(new[] { "Cooking" }, result.HeaderValues);
-
- Assert.Empty(result.ModelStateErrors);
- }
-
- private class Result
- {
- public string HeaderValue { get; set; }
-
- public string[] HeaderValues { get; set; }
-
- public string[] ModelStateErrors { get; set; }
- }
- }
-}
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/ModelBindingFromQueryTest.cs b/test/Microsoft.AspNet.Mvc.FunctionalTests/ModelBindingFromQueryTest.cs
deleted file mode 100644
index 282d51fb74..0000000000
--- a/test/Microsoft.AspNet.Mvc.FunctionalTests/ModelBindingFromQueryTest.cs
+++ /dev/null
@@ -1,115 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-using System.Net.Http;
-using System.Threading.Tasks;
-using ModelBindingWebSite;
-using ModelBindingWebSite.Controllers;
-using ModelBindingWebSite.Models;
-using Newtonsoft.Json;
-using Xunit;
-
-namespace Microsoft.AspNet.Mvc.FunctionalTests
-{
- public class ModelBindingFromQueryTest : IClassFixture>
- {
- public ModelBindingFromQueryTest(MvcTestFixture fixture)
- {
- Client = fixture.Client;
- }
-
- public HttpClient Client { get; }
-
- [Fact]
- public async Task FromQuery_CustomModelPrefix_ForParameter()
- {
- // Arrange
- // [FromQuery(Name = "customPrefix")] is used to apply a prefix
- var url =
- "http://localhost/FromQueryAttribute_Company/CreateCompany?customPrefix.Employees[0].Name=somename";
-
- // Act
- var response = await Client.GetAsync(url);
-
- // Assert
- var body = await response.Content.ReadAsStringAsync();
- var company = JsonConvert.DeserializeObject(body);
-
- var employee = Assert.Single(company.Employees);
- Assert.Equal("somename", employee.Name);
- }
-
- [Fact]
- public async Task FromQuery_CustomModelPrefix_ForCollectionParameter()
- {
- // Arrange
- var url =
- "http://localhost/FromQueryAttribute_Company/CreateCompanyFromEmployees?customPrefix[0].Name=somename";
-
- // Act
- var response = await Client.GetAsync(url);
-
- // Assert
- var body = await response.Content.ReadAsStringAsync();
- var company = JsonConvert.DeserializeObject(body);
-
- var employee = Assert.Single(company.Employees);
- Assert.Equal("somename", employee.Name);
- }
-
- [Fact]
- public async Task FromQuery_CustomModelPrefix_ForProperty()
- {
- // Arrange
- // [FromQuery(Name = "EmployeeId")] is used to apply a prefix
- var url =
- "http://localhost/FromQueryAttribute_Company/CreateCompany?customPrefix.Employees[0].EmployeeId=1234";
-
- // Act
- var response = await Client.GetAsync(url);
-
- // Assert
- var body = await response.Content.ReadAsStringAsync();
- var company = JsonConvert.DeserializeObject(body);
-
- var employee = Assert.Single(company.Employees);
-
- Assert.Equal(1234, employee.Id);
- }
-
- [Fact]
- public async Task FromQuery_CustomModelPrefix_ForCollectionProperty()
- {
- // Arrange
- var url = "http://localhost/FromQueryAttribute_Company/CreateDepartment?TestEmployees[0].EmployeeId=1234";
-
- // Act
- var response = await Client.GetAsync(url);
-
- // Assert
- var body = await response.Content.ReadAsStringAsync();
- var department = JsonConvert.DeserializeObject<
- FromQueryAttribute_CompanyController.FromQuery_Department>(body);
-
- var employee = Assert.Single(department.Employees);
- Assert.Equal(1234, employee.Id);
- }
-
- [Fact]
- public async Task FromQuery_NonExistingValueAddsValidationErrors_OnProperty_UsingCustomModelPrefix()
- {
- // Arrange
- var url =
- "http://localhost/FromQueryAttribute_Company/ValidateDepartment?TestEmployees[0].Department=contoso";
-
- // Act
- var response = await Client.GetAsync(url);
-
- // Assert
- var body = await response.Content.ReadAsStringAsync();
- var result = JsonConvert.DeserializeObject(body);
- var error = Assert.Single(result.ModelStateErrors);
- Assert.Equal("TestEmployees[0].EmployeeId", error);
- }
- }
-}
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/ModelBindingFromRouteTest.cs b/test/Microsoft.AspNet.Mvc.FunctionalTests/ModelBindingFromRouteTest.cs
deleted file mode 100644
index 3cdac27316..0000000000
--- a/test/Microsoft.AspNet.Mvc.FunctionalTests/ModelBindingFromRouteTest.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-using System.Collections.Generic;
-using System.Net.Http;
-using System.Threading.Tasks;
-using ModelBindingWebSite;
-using ModelBindingWebSite.Models;
-using Newtonsoft.Json;
-using Xunit;
-
-namespace Microsoft.AspNet.Mvc.FunctionalTests
-{
- public class ModelBindingFromRouteTest : IClassFixture>
- {
- public ModelBindingFromRouteTest(MvcTestFixture fixture)
- {
- Client = fixture.Client;
- }
-
- public HttpClient Client { get; }
-
- [Fact]
- public async Task FromRoute_CustomModelPrefix_ForParameter()
- {
- // Arrange
- // [FromRoute(Name = "customPrefix")] is used to apply a prefix
- var url = "http://localhost/FromRouteAttribute_Company/CreateEmployee/somename";
-
- // Act
- var response = await Client.GetAsync(url);
-
- // Assert
- var body = await response.Content.ReadAsStringAsync();
- var employee = JsonConvert.DeserializeObject(body);
- Assert.Equal("somename", employee.Name);
- }
-
- [Fact]
- public async Task FromRoute_CustomModelPrefix_ForProperty()
- {
- // Arrange
- // [FromRoute(Name = "EmployeeId")] is used to apply a prefix
- var url = "http://localhost/FromRouteAttribute_Company/CreateEmployee/somename/1234";
-
- // Act
- var response = await Client.GetAsync(url);
-
- // Assert
- var body = await response.Content.ReadAsStringAsync();
- var employee = JsonConvert.DeserializeObject(body);
- Assert.Equal(1234, employee.TaxId);
- }
-
-
- [Fact]
- public async Task FromRoute_NonExistingValueAddsValidationErrors_OnProperty_UsingCustomModelPrefix()
- {
- // Arrange
- // [FromRoute(Name = "TestEmployees")] is used to apply a prefix
- var url = "http://localhost/FromRouteAttribute_Company/ValidateDepartment/contoso";
- var request = new HttpRequestMessage(HttpMethod.Post, url);
-
- // No values.
- var nameValueCollection = new List>();
- request.Content = new FormUrlEncodedContent(nameValueCollection);
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- var body = await response.Content.ReadAsStringAsync();
- var result = JsonConvert.DeserializeObject(body);
- Assert.Null(result.Value);
- var error = Assert.Single(result.ModelStateErrors);
- Assert.Equal("TestEmployees", error);
- }
- }
-}
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/ModelBindingModelBinderAttributeTest.cs b/test/Microsoft.AspNet.Mvc.FunctionalTests/ModelBindingModelBinderAttributeTest.cs
deleted file mode 100644
index a63e4e56f5..0000000000
--- a/test/Microsoft.AspNet.Mvc.FunctionalTests/ModelBindingModelBinderAttributeTest.cs
+++ /dev/null
@@ -1,114 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-using System.Net.Http;
-using System.Threading.Tasks;
-using ModelBindingWebSite.Models;
-using Newtonsoft.Json;
-using Xunit;
-
-namespace Microsoft.AspNet.Mvc.FunctionalTests
-{
- public class ModelBindingModelBinderAttributeTest : IClassFixture>
- {
- public ModelBindingModelBinderAttributeTest(MvcTestFixture fixture)
- {
- Client = fixture.Client;
- }
-
- public HttpClient Client { get; }
-
- [Fact]
- public async Task ModelBinderAttribute_CustomModelPrefix()
- {
- // Arrange
- // [ModelBinder(Name = "customPrefix")] is used to apply a prefix
- var url =
- "http://localhost/ModelBinderAttribute_Company/GetCompany?customPrefix.Employees[0].Name=somename";
-
- // Act
- var response = await Client.GetAsync(url);
-
- // Assert
- var body = await response.Content.ReadAsStringAsync();
- var company = JsonConvert.DeserializeObject(body);
-
- var employee = Assert.Single(company.Employees);
- Assert.Equal("somename", employee.Name);
- }
-
- [Fact]
- public async Task ModelBinderAttribute_CustomModelPrefix_OnProperty()
- {
- // Arrange
- var url = "http://localhost/ModelBinderAttribute_Company/CreateCompany?employees[0].Alias=somealias";
-
- // Act
- var response = await Client.GetAsync(url);
-
- // Assert
- var body = await response.Content.ReadAsStringAsync();
- var company = JsonConvert.DeserializeObject(body);
-
- var employee = Assert.Single(company.Employees);
- Assert.Equal("somealias", employee.EmailAlias);
- }
-
- [Fact]
- public async Task ModelBinderAttribute_WithPrefixOnParameter()
- {
- // Arrange
- // [ModelBinder(Name = "customPrefix")] is used to apply a prefix
- var url = "http://localhost/ModelBinderAttribute_Product/GetBinderType_UseModelBinderOnType" +
- "?customPrefix.ProductId=5";
-
- // Act
- var response = await Client.GetAsync(url);
-
- // Assert
- var body = await response.Content.ReadAsStringAsync();
- Assert.Equal(
- "ModelBindingWebSite.Controllers.ModelBinderAttribute_ProductController+ProductModelBinder",
- body);
- }
-
- [Fact]
- public async Task ModelBinderAttribute_WithBinderOnParameter()
- {
- // Arrange
- var url = "http://localhost/ModelBinderAttribute_Product/GetBinderType_UseModelBinder/" +
- "?model.productId=5";
-
- // Act
- var response = await Client.GetAsync(url);
-
- // Assert
- var body = await response.Content.ReadAsStringAsync();
- Assert.Equal(
- "ModelBindingWebSite.Controllers.ModelBinderAttribute_ProductController+ProductModelBinder",
- body);
- }
-
- [Fact]
- public async Task ModelBinderAttribute_WithBinderOnEnum()
- {
- // Arrange
- var url = "http://localhost/ModelBinderAttribute_Product/ModelBinderAttribute_UseModelBinderOnEnum" +
- "?status=Shipped";
-
- // Act
- var response = await Client.GetAsync(url);
-
- // Assert
- var body = await response.Content.ReadAsStringAsync();
- Assert.Equal("StatusShipped", body);
- }
-
- private class Product
- {
- public int ProductId { get; set; }
-
- public string BinderType { get; set; }
- }
- }
-}
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/ModelBindingTest.cs b/test/Microsoft.AspNet.Mvc.FunctionalTests/ModelBindingTest.cs
deleted file mode 100644
index 726275d7b9..0000000000
--- a/test/Microsoft.AspNet.Mvc.FunctionalTests/ModelBindingTest.cs
+++ /dev/null
@@ -1,1835 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Linq.Expressions;
-using System.Net;
-using System.Net.Http;
-using System.Reflection;
-using System.Text;
-using System.Threading.Tasks;
-using Microsoft.AspNet.Testing;
-#if DNX451
-using Microsoft.AspNet.Testing.xunit;
-#endif
-using ModelBindingWebSite.Models;
-using ModelBindingWebSite.ViewModels;
-using Newtonsoft.Json;
-using Xunit;
-
-namespace Microsoft.AspNet.Mvc.FunctionalTests
-{
- public class ModelBindingTest : IClassFixture>
- {
- private static readonly Assembly _assembly = typeof(ModelBindingTest).GetTypeInfo().Assembly;
-
- public ModelBindingTest(MvcTestFixture fixture)
- {
- Client = fixture.Client;
- }
-
- public HttpClient Client { get; }
-
- [Fact]
- public async Task DoNotValidate_ParametersOrControllerProperties_IfSourceNotFromRequest()
- {
- // Arrange & Act
- var response = await Client.GetStringAsync("http://localhost/Validation/DoNotValidateParameter");
-
- // Assert
- Assert.Equal("true", response);
- }
-
- [Fact]
- public async Task ModelValidation_DoesNotValidate_AnAlreadyValidatedObject()
- {
- // Arrange & Act
- var response = await Client.GetStringAsync("http://localhost/Validation/AvoidRecursive?Name=selfish");
-
- // Assert
- Assert.Equal("true", response);
- }
-
- [Theory]
- [InlineData("RestrictValueProvidersUsingFromRoute", "valueFromRoute")]
- [InlineData("RestrictValueProvidersUsingFromQuery", "valueFromQuery")]
- [InlineData("RestrictValueProvidersUsingFromForm", "valueFromForm")]
- public async Task CompositeModelBinder_Restricts_ValueProviders(string actionName, string expectedValue)
- {
- // Arrange
- // Provide all three values, it should bind based on the attribute on the action method.
- var request = new HttpRequestMessage(
- HttpMethod.Post,
- string.Format("http://localhost/CompositeTest/{0}/valueFromRoute?param=valueFromQuery", actionName));
- var nameValueCollection = new List>
- {
- new KeyValuePair("param", "valueFromForm"),
- };
-
- request.Content = new FormUrlEncodedContent(nameValueCollection);
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- Assert.Equal(expectedValue, await response.Content.ReadAsStringAsync());
- }
-
- [Fact]
- public async Task TryUpdateModel_WithAPropertyFromBody()
- {
- // Arrange
- // the name would be of customer.Department.Name
- // and not for the top level customer object.
- var input = "{\"Name\":\"RandomDepartment\"}";
- var content = new StringContent(input, Encoding.UTF8, "application/json");
-
- // Act
- var response = await Client.PostAsync("http://localhost/Home/GetCustomer?Id=1234", content);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var customer = JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync());
- Assert.NotNull(customer.Department);
- Assert.Equal("RandomDepartment", customer.Department.Name);
- Assert.Equal(1234, customer.Id);
- Assert.Equal(25, customer.Age);
- Assert.Equal("dummy", customer.Name);
- }
-
- [Fact]
- public async Task CanModelBindServiceToAnArgument()
- {
- // Arrange & Act
- var response = await Client.GetAsync("http://localhost/FromServices_Calculator/Add?left=1234&right=1");
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- Assert.Equal("1235", await response.Content.ReadAsStringAsync());
- }
-
- [Fact]
- public async Task CanModelBindServiceToAProperty()
- {
- // Arrange & Act
- var response = await Client.GetAsync(
- "http://localhost/FromServices_Calculator/Calculate?Left=10&Right=5&Operator=*");
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- Assert.Equal("50", await response.Content.ReadAsStringAsync());
- }
-
- [Fact]
- public async Task CanModelBindServiceToAProperty_OnBaseType()
- {
- // Arrange & Act
- var response = await Client.GetAsync(
- "http://localhost/FromServices_Calculator/CalculateWithPrecision?Left=10&Right=5&Operator=*");
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- Assert.Equal("50", await response.Content.ReadAsStringAsync());
- }
-
- [Fact]
- public async Task ControllerPropertyAndAnActionWithoutFromBody_InvokesWithoutErrors()
- {
- // Arrange & Act
- var response = await Client.GetAsync("http://localhost/FromBodyControllerProperty/GetSiteUser");
-
- // Assert
- Assert.Equal(HttpStatusCode.NoContent, response.StatusCode);
- }
-
- [Fact]
- public async Task CanBind_MultipleParameters_UsingFromForm()
- {
- // Arrange
- var request = new HttpRequestMessage(
- HttpMethod.Post,
- "http://localhost/FromAttributes/MultipleFromFormParameters");
- var nameValueCollection = new List>
- {
- new KeyValuePair("homeAddress.Street", "1"),
- new KeyValuePair("homeAddress.State", "WA_Form_Home"),
- new KeyValuePair("homeAddress.Zip", "2"),
- new KeyValuePair("officeAddress.Street", "3"),
- new KeyValuePair("officeAddress.State", "WA_Form_Office"),
- new KeyValuePair("officeAddress.Zip", "4"),
- };
-
- request.Content = new FormUrlEncodedContent(nameValueCollection);
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var user = JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync());
-
- Assert.Equal("WA_Form_Home", user.HomeAddress.State);
- Assert.Equal(1, user.HomeAddress.Street);
- Assert.Equal(2, user.HomeAddress.Zip);
-
- Assert.Equal("WA_Form_Office", user.OfficeAddress.State);
- Assert.Equal(3, user.OfficeAddress.Street);
- Assert.Equal(4, user.OfficeAddress.Zip);
- }
-
- [Fact]
- public async Task CanBind_MultipleProperties_UsingFromForm()
- {
- // Arrange
- var request = new HttpRequestMessage(
- HttpMethod.Post,
- "http://localhost/FromAttributes/MultipleFromFormParameterAndProperty");
- var nameValueCollection = new List>
- {
- new KeyValuePair("Street", "1"),
- new KeyValuePair("State", "WA_Form_Home"),
- new KeyValuePair("Zip", "2"),
- new KeyValuePair("officeAddress.Street", "3"),
- new KeyValuePair("officeAddress.State", "WA_Form_Office"),
- new KeyValuePair("officeAddress.Zip", "4"),
- };
-
- request.Content = new FormUrlEncodedContent(nameValueCollection);
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var user = JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync());
-
- Assert.Equal("WA_Form_Home", user.HomeAddress.State);
- Assert.Equal(1, user.HomeAddress.Street);
- Assert.Equal(2, user.HomeAddress.Zip);
-
- Assert.Equal("WA_Form_Office", user.OfficeAddress.State);
- Assert.Equal(3, user.OfficeAddress.Street);
- Assert.Equal(4, user.OfficeAddress.Zip);
- }
-
- [Fact]
- public async Task CanBind_ComplexData_OnParameters_UsingFromAttributes()
- {
- // Arrange
- // Provide all three values, it should bind based on the attribute on the action method.
- var request = new HttpRequestMessage(
- HttpMethod.Post,
- "http://localhost/FromAttributes/GetUser/5/WA_Route/6" +
- "?Street=3&State=WA_Query&Zip=4");
- var nameValueCollection = new List>
- {
- new KeyValuePair("Street", "1"),
- new KeyValuePair("State", "WA_Form"),
- new KeyValuePair("Zip", "2"),
- };
-
- request.Content = new FormUrlEncodedContent(nameValueCollection);
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var user = JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync());
-
- // Assert FromRoute
- Assert.Equal("WA_Route", user.HomeAddress.State);
- Assert.Equal(5, user.HomeAddress.Street);
- Assert.Equal(6, user.HomeAddress.Zip);
-
- // Assert FromForm
- Assert.Equal("WA_Form", user.OfficeAddress.State);
- Assert.Equal(1, user.OfficeAddress.Street);
- Assert.Equal(2, user.OfficeAddress.Zip);
-
- // Assert FromQuery
- Assert.Equal("WA_Query", user.ShippingAddress.State);
- Assert.Equal(3, user.ShippingAddress.Street);
- Assert.Equal(4, user.ShippingAddress.Zip);
- }
-
- [Fact]
- public async Task CanBind_ComplexData_OnProperties_UsingFromAttributes()
- {
- // Arrange
- // Provide all three values, it should bind based on the attribute on the action method.
- var request = new HttpRequestMessage(
- HttpMethod.Post,
- "http://localhost/FromAttributes/GetUser_FromForm/5/WA_Route/6" +
- "?ShippingAddress.Street=3&ShippingAddress.State=WA_Query&ShippingAddress.Zip=4");
- var nameValueCollection = new List>
- {
- new KeyValuePair("OfficeAddress.Street", "1"),
- new KeyValuePair("OfficeAddress.State", "WA_Form"),
- new KeyValuePair("OfficeAddress.Zip", "2"),
- };
-
- request.Content = new FormUrlEncodedContent(nameValueCollection);
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var user = JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync());
-
- // Assert FromRoute
- Assert.Equal("WA_Route", user.HomeAddress.State);
- Assert.Equal(5, user.HomeAddress.Street);
- Assert.Equal(6, user.HomeAddress.Zip);
-
- // Assert FromForm
- Assert.Equal("WA_Form", user.OfficeAddress.State);
- Assert.Equal(1, user.OfficeAddress.Street);
- Assert.Equal(2, user.OfficeAddress.Zip);
-
- // Assert FromQuery
- Assert.Equal("WA_Query", user.ShippingAddress.State);
- Assert.Equal(3, user.ShippingAddress.Street);
- Assert.Equal(4, user.ShippingAddress.Zip);
- }
-
- [Fact]
- public async Task CanBind_ComplexData_OnProperties_UsingFromAttributes_WithBody()
- {
- // Arrange
- // Provide all three values, it should bind based on the attribute on the action method.
- var request = new HttpRequestMessage(
- HttpMethod.Post,
- "http://localhost/FromAttributes/GetUser_FromBody/5/WA_Route/6" +
- "?ShippingAddress.Street=3&ShippingAddress.State=WA_Query&ShippingAddress.Zip=4");
- var input = "{\"State\":\"WA_Body\",\"Street\":1,\"Zip\":2}";
-
- request.Content = new StringContent(input, Encoding.UTF8, "application/json");
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var user = JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync());
-
- // Assert FromRoute
- Assert.Equal("WA_Route", user.HomeAddress.State);
- Assert.Equal(5, user.HomeAddress.Street);
- Assert.Equal(6, user.HomeAddress.Zip);
-
- // Assert FromBody
- Assert.Equal("WA_Body", user.OfficeAddress.State);
- Assert.Equal(1, user.OfficeAddress.Street);
- Assert.Equal(2, user.OfficeAddress.Zip);
-
- // Assert FromQuery
- Assert.Equal("WA_Query", user.ShippingAddress.State);
- Assert.Equal(3, user.ShippingAddress.Street);
- Assert.Equal(4, user.ShippingAddress.Zip);
- }
-
-
- [Fact]
- public async Task NonExistingModelBinder_ForABinderMetadata_DoesNotRecurseInfinitely()
- {
- // Arrange & Act & Assert
- var response = await Client.GetStringAsync("http://localhost/WithBinderMetadata/EchoDocument");
- var document = JsonConvert.DeserializeObject(response);
-
- Assert.NotNull(document);
- Assert.Null(document.Version);
- Assert.Null(document.SubDocument);
- }
-
- [Fact]
- public async Task ParametersWithNoValueProviderMetadataUseTheAvailableValueProviders()
- {
- // Arrange & Act
- var response = await Client.GetAsync("http://localhost/WithBinderMetadata" +
- "/ParametersWithNoValueProviderMetadataUseTheAvailableValueProviders" +
- "?Name=somename&Age=12");
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var emp = JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync());
- Assert.Null(emp.Department);
- Assert.Equal("somename", emp.Name);
- Assert.Equal(12, emp.Age);
- }
-
- [Fact]
- public async Task ParametersAreAlwaysCreated_IfValuesAreProvidedWithoutModelName()
- {
- // Arrange & Act
- var response = await Client.GetAsync("http://localhost/WithoutBinderMetadata" +
- "/GetPersonParameter" +
- "?Name=somename&Age=12");
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var person = JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync());
- Assert.NotNull(person);
- Assert.Equal("somename", person.Name);
- Assert.Equal(12, person.Age);
- }
-
- [Fact]
- public async Task ParametersAreAlwaysCreated_IfValueIsProvidedForModelName()
- {
- // Arrange & Act
- // here p is the model name.
- var response = await Client.GetAsync("http://localhost/WithoutBinderMetadata/GetPersonParameter?p=");
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var person = JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync());
- Assert.NotNull(person);
- Assert.Null(person.Name);
- Assert.Equal(0, person.Age);
- }
-
- [Fact]
- public async Task ParametersAreAlwaysCreated_IfNoValuesAreProvided()
- {
- // Arrange & Act
- var response = await Client.GetAsync("http://localhost/WithoutBinderMetadata/GetPersonParameter");
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var person = JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync());
- Assert.NotNull(person);
- Assert.Null(person.Name);
- Assert.Equal(0, person.Age);
- }
-
- [Fact]
- public async Task PropertiesAreBound_IfTheyAreProvidedByValueProviders()
- {
- // Arrange & Act
- var response = await Client.GetAsync(
- "http://localhost/Properties/GetCompany?Employees[0].Name=somename&Age=12");
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var company = JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync());
- Assert.NotNull(company);
- Assert.NotNull(company.Employees);
- Assert.Equal(1, company.Employees.Count);
- Assert.NotNull(company.Employees[0].Name);
- }
-
- [Fact]
- public async Task PropertiesAreBound_IfTheyAreMarkedExplicitly()
- {
- // Arrange & Act
- var response = await Client.GetAsync("http://localhost/Properties/GetCompany");
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var company = JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync());
- Assert.NotNull(company);
- Assert.NotNull(company.CEO);
- Assert.Null(company.CEO.Name);
- }
-
- [Fact]
- public async Task PropertiesAreBound_IfTheyArePocoMetadataMarkedTypes()
- {
- // Arrange & Act
- var response = await Client.GetAsync("http://localhost/Properties/GetCompany");
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var company = JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync());
- Assert.NotNull(company);
-
- // Department property is not null because it was a marker poco.
- Assert.NotNull(company.Department);
-
- // beacause no value is provided.
- Assert.Null(company.Department.Name);
- }
-
- [Fact]
- public async Task PropertiesAreNotBound_ByDefault()
- {
- // Arrange & Act
- var response = await Client.GetAsync("http://localhost/Properties/GetCompany");
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var company = JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync());
- Assert.NotNull(company);
- Assert.Null(company.Employees);
- }
-
- [Fact]
- public async Task PocoGetsCreated_IfTopLevelNoProperties()
- {
- // Arrange & Act
- var response = await Client.GetAsync("http://localhost/Properties/GetPerson");
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var person = JsonConvert.DeserializeObject(
- await response.Content.ReadAsStringAsync());
- Assert.NotNull(person);
- Assert.Null(person.Name);
- }
-
- [Fact]
- public async Task ArrayOfPocoGetsCreated_PoCoWithNoProperties()
- {
- // Arrange & Act
- var response = await Client.GetAsync("http://localhost/Properties/GetPeople?people[0].Name=asdf");
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var arrperson = JsonConvert.DeserializeObject(
- await response.Content.ReadAsStringAsync());
- Assert.NotNull(arrperson);
- Assert.NotNull(arrperson.people);
- Assert.Equal(0, arrperson.people.Length);
- }
-
- [Theory]
- [InlineData("http://localhost/Home/ActionWithPersonFromUrlWithPrefix/Javier/26")]
- [InlineData("http://localhost/Home/ActionWithPersonFromUrlWithoutPrefix/Javier/26")]
- public async Task CanBind_ComplexData_FromRouteData(string url)
- {
- // Arrange & Act
- var response = await Client.GetAsync(url);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
-
- var body = await response.Content.ReadAsStringAsync();
- Assert.NotNull(body);
-
- var person = JsonConvert.DeserializeObject(body);
- Assert.NotNull(person);
- Assert.Equal("Javier", person.Name);
- Assert.Equal(26, person.Age);
- }
-
- [Fact]
- public async Task ModelBindCancellationTokenParameteres()
- {
- // Arrange & Act
- var response = await Client.GetAsync("http://localhost/Home/ActionWithCancellationToken");
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- Assert.Equal("true", await response.Content.ReadAsStringAsync());
- }
-
- [Fact]
- public async Task ModelBindCancellationToken_ForProperties()
- {
- // Arrange & Act
- var response = await Client.GetAsync(
- "http://localhost/Home/ActionWithCancellationTokenModel?wrapper=bogusValue");
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- Assert.Equal("true", await response.Content.ReadAsStringAsync());
- }
-
- [Fact]
- public async Task ModelBindingBindsBase64StringsToByteArrays()
- {
- // Arrange & Act
- var response = await Client.GetAsync("http://localhost/Home/Index?byteValues=SGVsbG9Xb3JsZA==");
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- Assert.Equal("HelloWorld", await response.Content.ReadAsStringAsync());
- }
-
- [Fact]
- public async Task ModelBindingBindsEmptyStringsToByteArrays()
- {
- // Arrange & Act
- var response = await Client.GetAsync("http://localhost/Home/Index?byteValues=");
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- Assert.Equal(string.Empty, await response.Content.ReadAsStringAsync());
- }
-
- [Fact]
- public async Task ModelBinding_LimitsErrorsToMaxErrorCount_DoesNotValidateMembersOfMissingProperties()
- {
- // Arrange
- var queryString = string.Join("=&", Enumerable.Range(0, 10).Select(i => "field" + i));
-
- // Act
- var response = await Client.GetStringAsync(
- "http://localhost/Home/ModelWithTooManyValidationErrors?" + queryString);
-
- // Assert
- var json = JsonConvert.DeserializeObject>(response);
-
- // 8 is the value of MaxModelValidationErrors for the application being tested.
- // Mono issue - https://github.com/aspnet/External/issues/19
- Assert.Equal(8, json.Count);
- Assert.Equal(PlatformNormalizer.NormalizeContent("The Field1 field is required."), json["Field1"]);
- Assert.Equal(PlatformNormalizer.NormalizeContent("The Field2 field is required."), json["Field2"]);
- Assert.Equal(PlatformNormalizer.NormalizeContent("The Field3 field is required."), json["Field3"]);
- Assert.Equal(PlatformNormalizer.NormalizeContent("The Field4 field is required."), json["Field4"]);
- Assert.Equal(PlatformNormalizer.NormalizeContent("The Field5 field is required."), json["Field5"]);
- Assert.Equal(PlatformNormalizer.NormalizeContent("The Field6 field is required."), json["Field6"]);
- Assert.Equal(PlatformNormalizer.NormalizeContent("The Field7 field is required."), json["Field7"]);
- Assert.Equal("The maximum number of allowed model errors has been reached.", json[""]);
- }
-
- [Fact]
- public async Task ModelBinding_FallsBackAndValidatesAllPropertiesInModel()
- {
- // Arrange & Act
- var response = await Client.GetStringAsync("http://localhost/Home/ModelWithFewValidationErrors?model=");
-
- // Assert
- var json = JsonConvert.DeserializeObject>(response);
- Assert.Equal(3, json.Count);
-
- // The model prefix 'model' is used in the modelstate keys because the key 'model' is present in the
- // query string. This causes modelbinding to commit to using the prefix.
- //
- // Mono issue - https://github.com/aspnet/External/issues/19
- Assert.Equal(PlatformNormalizer.NormalizeContent("The Field1 field is required."), json["model.Field1"]);
- Assert.Equal(PlatformNormalizer.NormalizeContent("The Field2 field is required."), json["model.Field2"]);
- Assert.Equal(PlatformNormalizer.NormalizeContent("The Field3 field is required."), json["model.Field3"]);
- }
-
- [Fact]
- public async Task ModelBinding_FallsBackAndSuccessfullyBindsStructCollection()
- {
- // Arrange
- var contentDictionary = new Dictionary
- {
- { "[0]", "23" },
- { "[1]", "97" },
- { "[2]", "103" },
- };
- var requestContent = new FormUrlEncodedContent(contentDictionary);
-
- // Act
- var response = await Client.PostAsync("http://localhost/integers", requestContent);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
-
- var responseContent = await response.Content.ReadAsStringAsync();
- var array = JsonConvert.DeserializeObject(responseContent);
-
- Assert.Equal(3, array.Length);
- Assert.Equal(23, array[0]);
- Assert.Equal(97, array[1]);
- Assert.Equal(103, array[2]);
- }
-
- [Fact]
- public async Task ModelBinding_FallsBackAndSuccessfullyBindsPOCOCollection()
- {
- // Arrange
- var contentDictionary = new Dictionary
- {
- { "[0].CityCode", "YYZ" },
- { "[0].CityName", "Toronto" },
- { "[1].CityCode", "SEA" },
- { "[1].CityName", "Seattle" },
- };
- var requestContent = new FormUrlEncodedContent(contentDictionary);
-
- // Act
- var response = await Client.PostAsync("http://localhost/cities", requestContent);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
-
- var responseContent = await response.Content.ReadAsStringAsync();
- var list = JsonConvert.DeserializeObject>(responseContent);
-
- Assert.Equal(2, list.Count);
- Assert.Equal(contentDictionary["[0].CityCode"], list[0].CityCode);
- Assert.Equal(contentDictionary["[0].CityName"], list[0].CityName);
- Assert.Equal(contentDictionary["[1].CityCode"], list[1].CityCode);
- Assert.Equal(contentDictionary["[1].CityName"], list[1].CityName);
- }
-
- [Fact]
- public async Task BindAttribute_Filters_UsingDefaultPropertyFilterProvider_WithExpressions()
- {
- // Arrange & Act
- var response = await Client.GetStringAsync("http://localhost/BindAttribute/" +
- "EchoUser" +
- "?user.UserName=someValue&user.RegisterationMonth=March&user.Id=123");
-
- // Assert
- var json = JsonConvert.DeserializeObject(response);
-
- // Does not touch what is not in the included expression.
- Assert.Equal(0, json.Id);
-
- // Updates the included properties.
- Assert.Equal("someValue", json.UserName);
- Assert.Equal("March", json.RegisterationMonth);
- }
-
- [Fact]
- public async Task BindAttribute_Filters_UsingPropertyFilterProvider_UsingServices()
- {
- // Arrange & Act
- var response = await Client.GetStringAsync("http://localhost/BindAttribute/" +
- "EchoUserUsingServices" +
- "?user.UserName=someValue&user.RegisterationMonth=March&user.Id=123");
-
- // Assert
- var json = JsonConvert.DeserializeObject(response);
-
- // Does not touch what is not in the included expression.
- Assert.Equal(0, json.Id);
-
- // Updates the included properties.
- Assert.Equal("someValue", json.UserName);
- Assert.Equal("March", json.RegisterationMonth);
- }
-
- [Fact]
- public async Task BindAttribute_Filters_UsingDefaultPropertyFilterProvider_WithPredicate()
- {
- // Arrange & Act
- var response = await Client.GetStringAsync("http://localhost/BindAttribute/" +
- "UpdateUserId_BlackListingAtEitherLevelDoesNotBind" +
- "?param1.LastName=someValue¶m2.Id=123");
-
- // Assert
- var json = JsonConvert.DeserializeObject>(response);
- Assert.Equal(2, json.Count);
- Assert.Null(json["param1.LastName"]);
- Assert.Equal("0", json["param2.Id"]);
- }
-
- [Fact]
- public async Task BindAttribute_AppliesAtBothParameterAndTypeLevelTogether_BlacklistedAtEitherLevelIsNotBound()
- {
- // Arrange & Act
- var response = await Client.GetStringAsync("http://localhost/BindAttribute/" +
- "UpdateUserId_BlackListingAtEitherLevelDoesNotBind" +
- "?param1.LastName=someValue¶m2.Id=123");
-
- // Assert
- var json = JsonConvert.DeserializeObject>(response);
- Assert.Equal(2, json.Count);
- Assert.Null(json["param1.LastName"]);
- Assert.Equal("0", json["param2.Id"]);
- }
-
- [Fact]
- public async Task BindAttribute_AppliesAtBothParameterAndTypeLevelTogether_IncludedAtBothLevelsIsBound()
- {
- // Arrange & Act
- var response = await Client.GetStringAsync("http://localhost/BindAttribute/" +
- "UpdateFirstName_IncludingAtBothLevelBinds" +
- "?param1.FirstName=someValue¶m2.Id=123");
-
- // Assert
- var json = JsonConvert.DeserializeObject>(response);
- Assert.Equal(1, json.Count);
- Assert.Equal("someValue", json["param1.FirstName"]);
- }
-
- [Fact]
- public async Task BindAttribute_AppliesAtBothParameterAndTypeLevelTogether_IncludingAtOneLevelIsNotBound()
- {
- // Arrange & Act
- var response = await Client.GetStringAsync("http://localhost/BindAttribute/" +
- "UpdateIsAdmin_IncludingAtOnlyOneLevelDoesNotBind" +
- "?param1.FirstName=someValue¶m1.IsAdmin=true");
-
- // Assert
- var json = JsonConvert.DeserializeObject>(response);
- Assert.Equal(2, json.Count);
- Assert.Equal("False", json["param1.IsAdmin"]);
- Assert.Null(json["param1.FirstName"]);
- }
-
- [Fact]
- public async Task BindAttribute_BindsUsingParameterPrefix()
- {
- // Arrange & Act
- var response = await Client.GetStringAsync("http://localhost/BindAttribute/" +
- "BindParameterUsingParameterPrefix" +
- "?randomPrefix.Value=someValue");
-
- // Assert
- Assert.Equal("someValue", response);
- }
-
- [Fact]
- public async Task BindAttribute_FallsBackOnTypePrefixIfNoParameterPrefixIsProvided()
- {
- // Arrange & Act
- var response = await Client.GetStringAsync("http://localhost/BindAttribute/" +
- "TypePrefixIsUsed" +
- "?TypePrefix.Value=someValue");
-
- // Assert
- Assert.Equal("someValue", response);
- }
-
- [Fact]
- public async Task BindAttribute_DoesNotFallBackOnEmptyPrefixIfParameterPrefixIsProvided()
- {
- // Arrange & Act
- var response = await Client.GetAsync("http://localhost/BindAttribute/" +
- "BindParameterUsingParameterPrefix" +
- "?Value=someValue");
-
- // Assert
- Assert.Equal(HttpStatusCode.NoContent, response.StatusCode);
- Assert.Equal(string.Empty, await response.Content.ReadAsStringAsync());
- }
-
- [Fact]
- public async Task TryUpdateModel_IncludeTopLevelProperty_IncludesAllSubProperties()
- {
- // Arrange & Act
- var response = await Client.GetStringAsync("http://localhost/TryUpdateModel/" +
- "GetUserAsync_IncludesAllSubProperties" +
- "?id=123&Key=34&RegistrationMonth=March&Address.Street=123&Address.Country.Name=USA&" +
- "Address.State=WA&Address.Country.Cities[0].CityName=Seattle&Address.Country.Cities[0].CityCode=SEA");
-
- // Assert
- var user = JsonConvert.DeserializeObject(response);
-
- // Should update everything under Address.
- Assert.Equal(123, user.Address.Street); // Included by default as sub properties are included.
- Assert.Equal("WA", user.Address.State); // Included by default as sub properties of address are included.
- Assert.Equal("USA", user.Address.Country.Name); // Included by default.
- Assert.Equal("Seattle", user.Address.Country.Cities[0].CityName); // Included by default.
- Assert.Equal("SEA", user.Address.Country.Cities[0].CityCode); // Included by default.
-
- // Should not update Any property at the same level as address.
- // Key is id + 20.
- Assert.Equal(143, user.Key);
- Assert.Null(user.RegisterationMonth);
- }
-
- [Fact]
- public async Task TryUpdateModel_ChainedPropertyExpression_Throws()
- {
- // Arrange
- Expression> expression = model => model.Address.Country;
- var expected = string.Format(
- "The passed expression of expression node type '{0}' is invalid." +
- " Only simple member access expressions for model properties are supported.",
- expression.Body.NodeType);
-
- // Act
- var response = await Client.GetAsync(
- "http://localhost/TryUpdateModel/GetUserAsync_WithChainedProperties?id=123");
-
- // Assert
- var exception = response.GetServerException();
- Assert.Equal(typeof(InvalidOperationException).FullName, exception.ExceptionType);
- Assert.Equal(expected, exception.ExceptionMessage);
- }
-
- [Fact]
- public async Task TryUpdateModel_FailsToUpdateProperties()
- {
- // Arrange & Act
- var response = await Client.GetStringAsync("http://localhost/TryUpdateModel/" +
- "TryUpdateModelFails" +
- "?id=123&RegisterationMonth=March&Key=123&UserName=SomeName");
-
- // Assert
- var result = JsonConvert.DeserializeObject(response);
- Assert.False(result);
- }
-
- [Fact]
- public async Task TryUpdateModel_IncludeExpression_WorksOnlyAtTopLevel()
- {
- // Arrange & Act
- var response = await Client.GetStringAsync("http://localhost/TryUpdateModel/" +
- "GetPerson" +
- "?Parent.Name=fatherName&Parent.Parent.Name=grandFatherName");
-
- // Assert
- var person = JsonConvert.DeserializeObject(response);
-
- // Act
- Assert.Equal("fatherName", person.Parent.Name);
-
- // Includes this as there is data from value providers, the include filter
- // only works for top level objects.
- Assert.Equal("grandFatherName", person.Parent.Parent.Name);
- }
-
- [Fact]
- public async Task TryUpdateModel_Validates_ForTopLevelNotIncludedProperties()
- {
- // Arrange & Act
- var response = await Client.GetStringAsync("http://localhost/TryUpdateModel/" +
- "CreateAndUpdateUser" +
- "?RegistedeburationMonth=March");
-
- // Assert
- var result = JsonConvert.DeserializeObject(response);
- Assert.False(result);
- }
-
- [Fact]
- public async Task TryUpdateModelExcludeSpecific_Properties()
- {
- // Arrange & Act
- var response = await Client.GetStringAsync("http://localhost/TryUpdateModel/" +
- "GetUserAsync_ExcludeSpecificProperties" +
- "?id=123&RegisterationMonth=March&Key=123&UserName=SomeName");
-
- // Assert
- var user = JsonConvert.DeserializeObject(response);
-
- // Should not update excluded properties.
- Assert.NotEqual(123, user.Key);
-
- // Should Update all explicitly included properties.
- Assert.Equal("March", user.RegisterationMonth);
- Assert.Equal("SomeName", user.UserName);
- }
-
- [Fact]
- public async Task TryUpdateModelIncludeSpecific_Properties()
- {
- // Arrange & Act
- var response = await Client.GetStringAsync("http://localhost/TryUpdateModel/" +
- "GetUserAsync_IncludeSpecificProperties" +
- "?id=123&RegisterationMonth=March&Key=123&UserName=SomeName");
-
- // Assert
- var user = JsonConvert.DeserializeObject(response);
-
- // Should not update any not explicitly mentioned properties.
- Assert.NotEqual("SomeName", user.UserName);
- Assert.NotEqual(123, user.Key);
-
- // Should Update all included properties.
- Assert.Equal("March", user.RegisterationMonth);
- }
-
- [Fact]
- public async Task TryUpdateModelIncludesAllProperties_ByDefault()
- {
- // Arrange & Act
- var response = await Client.GetStringAsync("http://localhost/TryUpdateModel/" +
- "GetUserAsync_IncludeAllByDefault" +
- "?id=123&RegisterationMonth=March&Key=123&UserName=SomeName");
-
- // Assert
- var user = JsonConvert.DeserializeObject(response);
-
- // Should not update any not explicitly mentioned properties.
- Assert.Equal("SomeName", user.UserName);
- Assert.Equal(123, user.Key);
-
- // Should Update all included properties.
- Assert.Equal("March", user.RegisterationMonth);
- }
-
- [Fact]
- public async Task UpdateVehicle_WithJson_ProducesModelStateErrors()
- {
- // Arrange
- var content = new
- {
- Year = 3012,
- InspectedDates = new[]
- {
- new DateTime(4065, 10, 10)
- },
- Make = "Volttrax",
- Model = "Epsum"
- };
-
- // Act
- var response = await Client.PutAsJsonAsync("http://localhost/api/vehicles/520", content);
-
- // Assert
- Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
-
- var body = await response.Content.ReadAsStringAsync();
- var modelStateErrors = JsonConvert.DeserializeObject>>(body);
-
- Assert.Equal(2, modelStateErrors.Count);
- // OrderBy is used because the order of the results may very depending on the platform / client.
- Assert.Equal(
- new[]
- {
- "The field Year must be between 1980 and 2034.",
- "Year is invalid"
- },
- modelStateErrors["Year"].OrderBy(item => item, StringComparer.Ordinal));
-
- var vinError = Assert.Single(modelStateErrors["Vin"]);
- // Mono issue - https://github.com/aspnet/External/issues/19
- Assert.Equal(PlatformNormalizer.NormalizeContent("The Vin field is required."), vinError);
- }
-
- [Fact]
- public async Task UpdateVehicle_WithJson_DoesPropertyValidationPriorToValidationAtType()
- {
- // Arrange
- var content = new
- {
- Year = 2007,
- InspectedDates = new[]
- {
- new DateTime(4065, 10, 10)
- },
- Make = "Volttrax",
- Model = "Epsum",
- Vin = "Pqrs"
- };
- var request = new HttpRequestMessage(HttpMethod.Put, "http://localhost/api/vehicles/520");
- request.Content = new StringContent(JsonConvert.SerializeObject(content), Encoding.UTF8, "application/json");
- request.Headers.TryAddWithoutValidation("X-TrackingId", "trackingid");
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
-
- var body = await response.Content.ReadAsStringAsync();
- var modelStateErrors = JsonConvert.DeserializeObject>>(body);
-
- var item = Assert.Single(modelStateErrors);
- Assert.Equal("InspectedDates", item.Key);
- var error = Assert.Single(item.Value);
- Assert.Equal("Inspection date cannot be later than year of manufacture.", error);
- }
-
- [Fact]
- public async Task UpdateVehicle_WithJson_BindsBodyAndServices()
- {
- // Arrange
- var trackingId = Guid.NewGuid().ToString();
- var postedContent = new
- {
- Year = 2010,
- InspectedDates = new List
- {
- new DateTime(2008, 10, 01),
- new DateTime(2009, 03, 01),
- },
- Make = "Volttrax",
- Model = "Epsum",
- Vin = "PQRS"
- };
- var request = new HttpRequestMessage(HttpMethod.Put, "http://localhost/api/vehicles/520");
- request.Content = new StringContent(
- JsonConvert.SerializeObject(postedContent),
- Encoding.UTF8,
- "application/json");
- request.Headers.TryAddWithoutValidation("X-TrackingId", trackingId);
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
-
- var body = await response.Content.ReadAsStringAsync();
- var actual = JsonConvert.DeserializeObject(body);
-
- Assert.Equal(postedContent.Vin, actual.Vin);
- Assert.Equal(postedContent.Make, actual.Make);
- Assert.Equal(postedContent.InspectedDates, actual.InspectedDates.Select(d => d.DateTime));
- Assert.Equal(trackingId, actual.LastUpdatedTrackingId);
- }
-
-#if DNX451
- [ConditionalFact]
- // Mono issue - https://github.com/aspnet/External/issues/18
- [FrameworkSkipCondition(RuntimeFrameworks.Mono)]
- public async Task UpdateVehicle_WithXml_BindsBodyServicesAndHeaders()
- {
- // Arrange
- var trackingId = Guid.NewGuid().ToString();
- var postedContent = new VehicleViewModel
- {
- Year = 2010,
- InspectedDates = new DateTimeOffset[]
- {
- new DateTimeOffset(2008, 10, 01, 8, 3, 1, TimeSpan.Zero),
- new DateTime(2009, 03, 01),
- },
- Make = "Volttrax",
- Model = "Epsum",
- Vin = "PQRS"
- };
- var request = new HttpRequestMessage(HttpMethod.Put, "http://localhost/api/vehicles/520");
- request.Content = new StringContent(
- JsonConvert.SerializeObject(postedContent),
- Encoding.UTF8,
- "application/json");
- request.Headers.TryAddWithoutValidation("X-TrackingId", trackingId);
-
- // Act
- var response = await Client.SendAsync(request);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
-
- var body = await response.Content.ReadAsStringAsync();
- var actual = JsonConvert.DeserializeObject(body);
-
- Assert.Equal(postedContent.Vin, actual.Vin);
- Assert.Equal(postedContent.Make, actual.Make);
- Assert.Equal(postedContent.InspectedDates, actual.InspectedDates);
- Assert.Equal(trackingId, actual.LastUpdatedTrackingId);
- }
-#endif
-
- // Simulates a browser based client that does a Ajax post for partial page updates.
- [Fact]
- public async Task UpdateDealerVehicle_PopulatesPropertyErrorsInViews()
- {
- // Arrange
- var outputFile = "compiler/resources/UpdateDealerVehicle_PopulatesPropertyErrorsInViews.txt";
- var expectedContent = await ResourceFile.ReadResourceAsync(_assembly, outputFile, sourceFile: false);
- var postedContent = new
- {
- Year = 9001,
- InspectedDates = new List
- {
- new DateTime(2008, 01, 01)
- },
- Make = "Acme",
- Model = "Epsum",
- Vin = "LongerThan8Chars",
-
- };
- var url = "http://localhost/dealers/32/update-vehicle?dealer.name=TestCarDealer&dealer.location=SE";
-
- // Act
- var response = await Client.PostAsJsonAsync(url, postedContent);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
-
- var responseContent = await response.Content.ReadAsStringAsync();
-#if GENERATE_BASELINES
- ResourceFile.UpdateFile(_assembly, outputFile, expectedContent, responseContent);
-#else
- // Mono issue - https://github.com/aspnet/External/issues/19
- expectedContent = PlatformNormalizer.NormalizeContent(expectedContent);
- if (TestPlatformHelper.IsMono)
- {
- expectedContent = expectedContent.Replace(
- "The field Year must be between 1980 and 2034.",
- "Year is invalid");
- }
-
- Assert.Equal(expectedContent, responseContent, ignoreLineEndingDifferences: true);
-#endif
- }
-
- [Fact]
- public async Task UpdateDealerVehicle_PopulatesValidationSummary()
- {
- // Arrange
- var outputFile = "compiler/resources/UpdateDealerVehicle_PopulatesValidationSummary.txt";
- var expectedContent = await ResourceFile.ReadResourceAsync(_assembly, outputFile, sourceFile: false);
- var postedContent = new
- {
- Year = 2013,
- InspectedDates = new List
- {
- new DateTime(2008, 01, 01)
- },
- Make = "Acme",
- Model = "Epsum",
- Vin = "8chars",
-
- };
- var url = "http://localhost/dealers/43/update-vehicle?dealer.name=TestCarDealer&dealer.location=SE";
-
- // Act
- var response = await Client.PostAsJsonAsync(url, postedContent);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
-
- var responseContent = await response.Content.ReadAsStringAsync();
-#if GENERATE_BASELINES
- ResourceFile.UpdateFile(_assembly, outputFile, expectedContent, responseContent);
-#else
- // Mono issue - https://github.com/aspnet/External/issues/19
- Assert.Equal(
- PlatformNormalizer.NormalizeContent(expectedContent),
- responseContent,
- ignoreLineEndingDifferences: true);
-#endif
- }
-
- [Fact]
- public async Task UpdateDealerVehicle_UsesDefaultValuesForOptionalProperties()
- {
- // Arrange
- var outputFile = "compiler/resources/UpdateDealerVehicle_UpdateSuccessful.txt";
- var expectedContent = await ResourceFile.ReadResourceAsync(_assembly, outputFile, sourceFile: false);
- var postedContent = new
- {
- Year = 2013,
- InspectedDates = new DateTimeOffset[]
- {
- new DateTimeOffset(new DateTime(2008, 11, 01), TimeSpan.FromHours(-7))
- },
- Make = "RealSlowCars",
- Model = "Epsum",
- Vin = "8chars",
-
- };
- var url = "http://localhost/dealers/43/update-vehicle?dealer.name=TestCarDealer&dealer.location=NE";
-
- // Act
- var response = await Client.PostAsJsonAsync(url, postedContent);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
-
- var responseContent = await response.Content.ReadAsStringAsync();
-#if GENERATE_BASELINES
- ResourceFile.UpdateFile(_assembly, outputFile, expectedContent, responseContent);
-#else
- Assert.Equal(expectedContent, responseContent, ignoreLineEndingDifferences: true);
-#endif
- }
-
- [Fact]
- public async Task FormFileModelBinder_CanBind_SingleFile()
- {
- // Arrange
- var url = "http://localhost/FileUpload/UploadSingle";
- var formData = new MultipartFormDataContent("Upload----");
- formData.Add(new StringContent("Test Content"), "file", "test.txt");
-
- // Act
- var response = await Client.PostAsync(url, formData);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var fileDetails = JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync());
- Assert.Equal("test.txt", fileDetails.Filename);
- Assert.Equal("Test Content", fileDetails.Content);
- }
-
- [Fact]
- public async Task FormFileModelBinder_CanBind_MultipleFiles()
- {
- // Arrange
- var url = "http://localhost/FileUpload/UploadMultiple";
- var formData = new MultipartFormDataContent("Upload----");
- formData.Add(new StringContent("Test Content 1"), "files", "test1.txt");
- formData.Add(new StringContent("Test Content 2"), "files", "test2.txt");
-
- // Act
- var response = await Client.PostAsync(url, formData);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var fileDetailsArray = JsonConvert.DeserializeObject(
- await response.Content.ReadAsStringAsync());
- Assert.Equal(2, fileDetailsArray.Length);
- Assert.Equal("test1.txt", fileDetailsArray[0].Filename);
- Assert.Equal("Test Content 1", fileDetailsArray[0].Content);
- Assert.Equal("test2.txt", fileDetailsArray[1].Filename);
- Assert.Equal("Test Content 2", fileDetailsArray[1].Content);
- }
-
- [Fact]
- public async Task FormFileModelBinder_CanBind_MultipleListOfFiles()
- {
- // Arrange
- var url = "http://localhost/FileUpload/UploadMultipleList";
- var formData = new MultipartFormDataContent("Upload----");
- formData.Add(new StringContent("Test Content 1"), "filelist1", "test1.txt");
- formData.Add(new StringContent("Test Content 2"), "filelist1", "test2.txt");
- formData.Add(new StringContent("Test Content 3"), "filelist2", "test3.txt");
- formData.Add(new StringContent("Test Content 4"), "filelist2", "test4.txt");
-
- // Act
- var response = await Client.PostAsync(url, formData);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var fileDetailsLookup = JsonConvert.DeserializeObject>>(
- await response.Content.ReadAsStringAsync());
- Assert.Equal(2, fileDetailsLookup.Count);
- var fileDetailsList1 = fileDetailsLookup["filelist1"];
- var fileDetailsList2 = fileDetailsLookup["filelist2"];
- Assert.Equal(2, fileDetailsList1.Count);
- Assert.Equal(2, fileDetailsList2.Count);
- Assert.Equal("test1.txt", fileDetailsList1[0].Filename);
- Assert.Equal("Test Content 1", fileDetailsList1[0].Content);
- Assert.Equal("test2.txt", fileDetailsList1[1].Filename);
- Assert.Equal("Test Content 2", fileDetailsList1[1].Content);
- Assert.Equal("test3.txt", fileDetailsList2[0].Filename);
- Assert.Equal("Test Content 3", fileDetailsList2[0].Content);
- Assert.Equal("test4.txt", fileDetailsList2[1].Filename);
- Assert.Equal("Test Content 4", fileDetailsList2[1].Content);
- }
-
- [Fact]
- public async Task FormFileModelBinder_CanBind_FileInsideModel()
- {
- // Arrange
- var url = "http://localhost/FileUpload/UploadModelWithFile";
- var formData = new MultipartFormDataContent("Upload----");
- formData.Add(new StringContent("Test Book"), "Name");
- formData.Add(new StringContent("Test Content"), "File", "test.txt");
-
- // Act
- var response = await Client.PostAsync(url, formData);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var book = JsonConvert.DeserializeObject>(
- await response.Content.ReadAsStringAsync());
- var bookName = book.Key;
- var fileDetails = book.Value;
- Assert.Equal("Test Book", bookName);
- Assert.Equal("test.txt", fileDetails.Filename);
- Assert.Equal("Test Content", fileDetails.Content);
- }
-
- [Fact]
- public async Task TryUpdateModel_ReturnDerivedAndBaseProperties()
- {
- // Arrange & Act
- var response = await Client.GetStringAsync("http://localhost/TryUpdateModel/" +
- "GetEmployeeAsync_BindToBaseDeclaredType" +
- "?Parent.Name=fatherName&Parent.Parent.Name=grandFatherName&Department=Sales");
-
- // Assert
- var employee = JsonConvert.DeserializeObject(response);
- Assert.Equal("fatherName", employee.Parent.Name);
- Assert.Equal("Sales", employee.Department);
-
- // Round-tripped value includes descendent instances for all properties with data in the request.
- Assert.Equal("grandFatherName", employee.Parent.Parent.Name);
- }
-
- [Fact]
- public async Task HtmlHelper_DisplayFor_ShowsPropertiesInModelMetadataOrder()
- {
- // Arrange
- var outputFile = "compiler/resources/ModelBindingWebSite.Vehicle.Details.html";
- var expectedContent = await ResourceFile.ReadResourceAsync(_assembly, outputFile, sourceFile: false);
- var url = "http://localhost/vehicles/42";
-
- // Act
- var response = await Client.GetAsync(url);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
-
- var responseContent = await response.Content.ReadAsStringAsync();
-#if GENERATE_BASELINES
- ResourceFile.UpdateFile(_assembly, outputFile, expectedContent, responseContent);
-#else
- Assert.Equal(expectedContent, responseContent, ignoreLineEndingDifferences: true);
-#endif
- }
-
- [Fact]
- public async Task HtmlHelper_EditorFor_ShowsPropertiesInModelMetadataOrder()
- {
- // Arrange
- var outputFile = "compiler/resources/ModelBindingWebSite.Vehicle.Edit.html";
- var expectedContent = await ResourceFile.ReadResourceAsync(_assembly, outputFile, sourceFile: false);
- var url = "http://localhost/vehicles/42/edit";
-
- // Act
- var response = await Client.GetAsync(url);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
-
- var responseContent = await response.Content.ReadAsStringAsync();
-#if GENERATE_BASELINES
- ResourceFile.UpdateFile(_assembly, outputFile, expectedContent, responseContent);
-#else
- // Mono issue - https://github.com/aspnet/External/issues/19
- Assert.Equal(
- PlatformNormalizer.NormalizeContent(expectedContent),
- responseContent,
- ignoreLineEndingDifferences: true);
-#endif
- }
-
- [Fact]
- public async Task HtmlHelper_EditorFor_ShowsPropertiesAndErrorsInModelMetadataOrder()
- {
- // Arrange
- var outputFile = "compiler/resources/ModelBindingWebSite.Vehicle.Edit.Invalid.html";
- var expectedContent = await ResourceFile.ReadResourceAsync(_assembly, outputFile, sourceFile: false);
- var url = "http://localhost/vehicles/42/edit";
- var contentDictionary = new Dictionary
- {
- { "Make", "Fast Cars" },
- { "Model", "the Fastener" },
- { "InspectedDates[0]", "14/10/1979 00:00:00 -08:00" },
- { "InspectedDates[1]", "16/10/1979 00:00:00 -08:00" },
- { "InspectedDates[2]", "02/11/1979 00:00:00 -08:00" },
- { "InspectedDates[3]", "13/11/1979 00:00:00 -08:00" },
- { "InspectedDates[4]", "05/12/1979 00:00:00 -08:00" },
- { "InspectedDates[5]", "12/12/1979 00:00:00 -08:00" },
- { "InspectedDates[6]", "19/12/1979 00:00:00 -08:00" },
- { "InspectedDates[7]", "26/12/1979 00:00:00 -08:00" },
- { "InspectedDates[8]", "28/12/1979 00:00:00 -08:00" },
- { "InspectedDates[9]", "29/12/1979 00:00:00 -08:00" },
- { "InspectedDates[10]", "01/04/1980 00:00:00 -08:00" },
- { "Vin", "8765432112345678" },
- { "Year", "1979" },
- };
- var requestContent = new FormUrlEncodedContent(contentDictionary);
-
- // Act
- var response = await Client.PostAsync(url, requestContent);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
-
- var responseContent = await response.Content.ReadAsStringAsync();
-#if GENERATE_BASELINES
- ResourceFile.UpdateFile(_assembly, outputFile, expectedContent, responseContent);
-#else
- // Mono issue - https://github.com/aspnet/External/issues/19
- Assert.Equal(
- PlatformNormalizer.NormalizeContent(expectedContent),
- responseContent,
- ignoreLineEndingDifferences: true);
-#endif
- }
-
- [Fact]
- public async Task ModelBinder_FormatsDontMatch_ThrowsUserFriendlyException()
-
- {
- // Arrange
- var url = "http://localhost/Home/GetErrorMessage";
-
- var nameValueCollection = new List>
- {
- new KeyValuePair("birthdate", "random string"),
- };
- var formData = new FormUrlEncodedContent(nameValueCollection);
-
- // Act
- var response = await Client.PostAsync(url, formData);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var result = await response.Content.ReadAsStringAsync();
- Assert.Equal("The value 'random string' is not valid for DateTime.", result);
- }
-
- [Fact]
- public async Task OverriddenMetadataProvider_CanChangeAdditionalValues()
- {
- // Arrange
- var url = "http://localhost/AdditionalValues";
- var expectedDictionary = new Dictionary
- {
- { "key1", "7d6d0de2-8d59-49ac-99cc-881423b75a76" },
- { "key2", "value2" },
- };
-
- // Act
- var response = await Client.GetAsync(url);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var responseContent = await response.Content.ReadAsStringAsync();
- var dictionary = JsonConvert.DeserializeObject>(responseContent);
- Assert.Equal(expectedDictionary, dictionary);
- }
-
- [Fact]
- public async Task OverriddenMetadataProvider_CanUseAttributesToChangeAdditionalValues()
- {
- // Arrange
- var url = "http://localhost/GroupNames";
- var expectedDictionary = new Dictionary
- {
- { "Model", "MakeAndModelGroup" },
- { "Make", "MakeAndModelGroup" },
- { "Vin", null },
- { "Year", null },
- { "InspectedDates", null },
- { "LastUpdatedTrackingId", "TrackingIdGroup" },
- };
-
- // Act
- var response = await Client.GetAsync(url);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var responseContent = await response.Content.ReadAsStringAsync();
- var dictionary = JsonConvert.DeserializeObject>(responseContent);
- Assert.Equal(expectedDictionary, dictionary);
- }
-
- [Fact]
- public async Task TryUpdateModelNonGeneric_IncludesAllProperties_CanBind()
- {
- // Arrange & Act
- var response = await Client.GetStringAsync("http://localhost/TryUpdateModel/" +
- "GetUserAsync_ModelType_IncludeAll" +
- "?id=123&RegisterationMonth=March&Key=123&UserName=SomeName");
-
- // Assert
- var user = JsonConvert.DeserializeObject(response);
-
- // Should not update any not explicitly mentioned properties.
- Assert.Equal("SomeName", user.UserName);
- Assert.Equal(123, user.Key);
-
- // Should Update all included properties.
- Assert.Equal("March", user.RegisterationMonth);
- }
-
- [Fact]
- public async Task FormCollectionModelBinder_CanBind_FormValues()
- {
- // Arrange
- var url = "http://localhost/FormCollection/ReturnValuesAsList";
- var nameValueCollection = new List>
- {
- new KeyValuePair("field1", "value1"),
- new KeyValuePair("field2", "value2"),
- };
- var formData = new FormUrlEncodedContent(nameValueCollection);
-
- // Act
- var response = await Client.PostAsync(url, formData);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var valuesList = JsonConvert.DeserializeObject>(await response.Content.ReadAsStringAsync());
- Assert.Equal(new List { "value1", "value2" }, valuesList);
- }
-
- [Fact]
- public async Task FormCollectionModelBinder_CanBind_FormValuesWithDuplicateKeys()
- {
- // Arrange
- var url = "http://localhost/FormCollection/ReturnValuesAsList";
- var nameValueCollection = new List>
- {
- new KeyValuePair("field1", "value1"),
- new KeyValuePair("field2", "value2"),
- new KeyValuePair("field1", "value3"),
- };
- var formData = new FormUrlEncodedContent(nameValueCollection);
-
- // Act
- var response = await Client.PostAsync(url, formData);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var valuesList = JsonConvert.DeserializeObject>(await response.Content.ReadAsStringAsync());
- Assert.Equal(new List { "value1,value3", "value2" }, valuesList);
- }
-
- [Fact]
- public async Task FormCollectionModelBinder_CannotBind_NonFormValues()
- {
- // Arrange
- var url = "http://localhost/FormCollection/ReturnCollectionCount";
- var data = new StringContent("Non form content");
-
- // Act
- var response = await Client.PostAsync(url, data);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var collectionCount = JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync());
- Assert.Equal(0, collectionCount);
- }
-
- [Fact]
- public async Task FormCollectionModelBinder_CanBind_FormWithFile()
- {
- // Arrange
- var url = "http://localhost/FormCollection/ReturnFileContent";
- var expectedContent = "Test Content";
- var formData = new MultipartFormDataContent("Upload----");
- formData.Add(new StringContent(expectedContent), "File", "test.txt");
-
- // Act
- var response = await Client.PostAsync(url, formData);
-
- // Assert
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var fileContent = await response.Content.ReadAsStringAsync();
- Assert.Equal(expectedContent, fileContent);
- }
-
- [Fact]
- public async Task TryUpdateModelNonGenericIncludesAllProperties_ByDefault()
- {
- // Arrange & Act
- var response = await Client.GetStringAsync("http://localhost/TryUpdateModel/" +
- "GetUserAsync_ModelType_IncludeAllByDefault" +
- "?id=123&RegisterationMonth=March&Key=123&UserName=SomeName");
-
- // Assert
- var user = JsonConvert.DeserializeObject(response);
-
- // Should not update any not explicitly mentioned properties.
- Assert.Equal("SomeName", user.UserName);
- Assert.Equal(123, user.Key);
-
- // Should Update all included properties.
- Assert.Equal("March", user.RegisterationMonth);
- }
-
- [Fact]
- public async Task BindModelAsync_WithCollection()
- {
- // Arrange
- var content = new Dictionary
- {
- { "AddressLines[0].Line", "Street Address 0" },
- { "AddressLines[1].Line", "Street Address 1" },
- { "ZipCode", "98052" },
- };
- var url = "http://localhost/Person_CollectionBinder/CollectionType";
- var formData = new FormUrlEncodedContent(content);
-
- // Act
- var response = await Client.PutAsync(url, formData);
-
- // Assert
- var address = await ReadValue(response);
- Assert.Equal(2, address.AddressLines.Count);
- Assert.Equal("Street Address 0", address.AddressLines[0].Line);
- Assert.Equal("Street Address 1", address.AddressLines[1].Line);
- Assert.Equal("98052", address.ZipCode);
- }
-
- [Fact]
- public async Task BindModelAsync_WithCollection_SpecifyingIndex()
- {
- // Arrange
- var content = new[]
- {
- new KeyValuePair("AddressLines.index", "3"),
- new KeyValuePair("AddressLines.index", "10000"),
- new KeyValuePair