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

Commit

Permalink
Bump test projects up to .NET 4.5.2
Browse files Browse the repository at this point in the history
- aspnet/Testing#248
- xUnit no longer supports .NET 4.5.1
- update AppVeyor config so this framework version is available
- build tests for desktop .NET only on Windows
  • Loading branch information
dougbu committed Feb 21, 2017
1 parent 39f41ea commit 63507c8
Show file tree
Hide file tree
Showing 49 changed files with 61 additions and 60 deletions.
3 changes: 2 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ build_script:
- build.cmd --quiet verify
clone_depth: 1
test: off
deploy: off
deploy: off
os: Visual Studio 2017 RC
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
"System.Diagnostics.TraceSource": "4.3.0"
}
},
"net451": {}
"net452": {}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
"System.Diagnostics.TraceSource": "4.3.0"
}
},
"net451": {}
"net452": {}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Microsoft.AspNetCore.Mvc.Infrastructure
{
#if NET451
#if NET452
public class ActionContextAccessorTests
{
private static void DomainFunc()
Expand Down
2 changes: 1 addition & 1 deletion test/Microsoft.AspNetCore.Mvc.Core.Test/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@
"System.Xml.XmlDocument": "4.3.0"
}
},
"net451": {}
"net452": {}
}
}
2 changes: 1 addition & 1 deletion test/Microsoft.AspNetCore.Mvc.Cors.Test/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"System.Diagnostics.TraceSource": "4.3.0"
}
},
"net451": {}
"net452": {}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
"System.Diagnostics.TraceSource": "4.3.0"
}
},
"net451": {}
"net452": {}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"System.Diagnostics.TraceSource": "4.3.0"
}
},
"net451": {}
"net452": {}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// 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.

#if NET451
#if NET452
using System;
using System.Collections.Generic;
using System.IO;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
"System.Diagnostics.TraceSource": "4.3.0"
}
},
"net451": {}
"net452": {}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ public CompilationOptionsTests(MvcTestFixture<RazorWebSite.Startup> fixture)
public async Task CompilationOptions_AreUsedByViewsAndPartials()
{
// Arrange
#if NET451
#if NET452
var expected =
@"This method is running from NET451
This method is only defined in NET451";
@"This method is running from NET452
This method is only defined in NET452";
#elif NETCOREAPP1_1
var expected =
@"This method is running from NETCOREAPP1_1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public async Task RuntimeErrorAreListedByErrorPageMiddleware()
// The desktop CLR does not correctly read the stack trace from portable PDBs. However generating full pdbs
// is only supported on machines with CLSID_CorSymWriter available. On desktop, we'll skip this test on
// machines without this component.
#if NET451
#if NET452
if (!SymbolsUtility.SupportsFullPdbGeneration())
{
return;
Expand Down
2 changes: 1 addition & 1 deletion test/Microsoft.AspNetCore.Mvc.FunctionalTests/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,6 @@
},
"imports": "portable-net451+win8"
},
"net451": {}
"net452": {}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
"System.Diagnostics.TraceSource": "4.3.0"
}
},
"net451": {}
"net452": {}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"System.Diagnostics.TraceSource": "4.3.0"
}
},
"net451": {}
"net452": {}
}
}
2 changes: 1 addition & 1 deletion test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
"System.Diagnostics.TraceSource": "4.3.0"
}
},
"net451": {}
"net452": {}
}
}
2 changes: 1 addition & 1 deletion test/Microsoft.AspNetCore.Mvc.Razor.Test/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@
"System.Diagnostics.TraceSource": "4.3.0"
}
},
"net451": {}
"net452": {}
}
}
2 changes: 1 addition & 1 deletion test/Microsoft.AspNetCore.Mvc.RazorPages.Test/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
}
}
},
"net451": {}
"net452": {}
}
}
2 changes: 1 addition & 1 deletion test/Microsoft.AspNetCore.Mvc.TagHelpers.Test/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
"System.Diagnostics.TraceSource": "4.3.0"
}
},
"net451": {}
"net452": {}
}
}
2 changes: 1 addition & 1 deletion test/Microsoft.AspNetCore.Mvc.Test/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"System.Xml.XmlDocument": "4.3.0"
}
},
"net451": {}
"net452": {}
}
}
2 changes: 1 addition & 1 deletion test/Microsoft.AspNetCore.Mvc.TestCommon/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"keyFile": "../../tools/Key.snk"
},
"frameworks": {
"net451": {},
"net452": {},
"netstandard1.6": {
"dependencies": {
"System.ComponentModel.Annotations": "4.3.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"shared": "**/*.cs",
"frameworks": {
"net451": {},
"net452": {},
"netstandard1.3": {
"dependencies": {
"NETStandard.Library": "1.6.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
"System.Diagnostics.TraceSource": "4.3.0"
}
},
"net451": {}
"net452": {}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
"System.Diagnostics.TraceSource": "4.3.0"
}
},
"net451": {}
"net452": {}
}
}
2 changes: 1 addition & 1 deletion test/WebSites/ApiExplorerWebSite/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"Microsoft.AspNetCore.StaticFiles": "1.2.0-*"
},
"frameworks": {
"net451": {},
"net452": {},
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
Expand Down
2 changes: 1 addition & 1 deletion test/WebSites/ApplicationModelWebSite/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"Microsoft.AspNetCore.StaticFiles": "1.2.0-*"
},
"frameworks": {
"net451": {},
"net452": {},
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
Expand Down
2 changes: 1 addition & 1 deletion test/WebSites/BasicWebSite/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"Microsoft.AspNetCore.StaticFiles": "1.2.0-*"
},
"frameworks": {
"net451": {},
"net452": {},
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"Microsoft.AspNetCore.Mvc": "1.2.0-*"
},
"frameworks": {
"net451": {},
"net452": {},
"netcoreapp1.1": {}
}
}
2 changes: 1 addition & 1 deletion test/WebSites/ControllersFromServicesWebSite/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"Microsoft.AspNetCore.StaticFiles": "1.2.0-*"
},
"frameworks": {
"net451": {},
"net452": {},
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
Expand Down
2 changes: 1 addition & 1 deletion test/WebSites/CorsWebSite/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"Microsoft.AspNetCore.StaticFiles": "1.2.0-*"
},
"frameworks": {
"net451": {},
"net452": {},
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
Expand Down
2 changes: 1 addition & 1 deletion test/WebSites/ErrorPageMiddlewareWebSite/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"Microsoft.AspNetCore.StaticFiles": "1.2.0-*"
},
"frameworks": {
"net451": {},
"net452": {},
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
Expand Down
2 changes: 1 addition & 1 deletion test/WebSites/FilesWebSite/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"Microsoft.Extensions.FileProviders.Embedded": "1.2.0-*"
},
"frameworks": {
"net451": {},
"net452": {},
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
Expand Down
2 changes: 1 addition & 1 deletion test/WebSites/FiltersWebSite/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"Microsoft.AspNetCore.StaticFiles": "1.2.0-*"
},
"frameworks": {
"net451": {},
"net452": {},
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
Expand Down
2 changes: 1 addition & 1 deletion test/WebSites/FormatterWebSite/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"Microsoft.AspNetCore.StaticFiles": "1.2.0-*"
},
"frameworks": {
"net451": {},
"net452": {},
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
Expand Down
2 changes: 1 addition & 1 deletion test/WebSites/HtmlGenerationWebSite/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"Microsoft.AspNetCore.StaticFiles": "1.2.0-*"
},
"frameworks": {
"net451": {},
"net452": {},
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"NETStandard.Library": "1.6.1"
},
"frameworks": {
"net451": {},
"net452": {},
"netstandard1.3": {}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"Microsoft.Extensions.DiagnosticAdapter": "1.2.0-*"
},
"frameworks": {
"net451": {},
"net452": {},
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
Expand Down
12 changes: 6 additions & 6 deletions test/WebSites/RazorWebSite/Services/FrameworkSpecificHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ public class FrameworkSpecificHelper
{
public string ExecuteOperation()
{
#if NET451 || DNX451
return "This method is running from NET451";
#if NET452
return "This method is running from NET452";
#elif NETCOREAPP1_1
return "This method is running from NETCOREAPP1_1";
#endif
}

#if NET451_CUSTOM_DEFINE
public string ExecuteNet451Operation()
#if NET452_CUSTOM_DEFINE
public string ExecuteNet452Operation()
{
return "This method is only defined in NET451";
return "This method is only defined in NET452";
}
#endif

#if NETCOREAPP1_1_CUSTOM_DEFINE
public string ExecuteNetCoreApp1_0Operation()
public string ExecuteNetCoreApp1_1Operation()
{
return "This method is only defined in NETCOREAPP1_1";
}
Expand Down
4 changes: 2 additions & 2 deletions test/WebSites/RazorWebSite/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public void ConfigureServices(IServiceCollection services)
$"{nameof(RazorWebSite)}.EmbeddedViews"));
options.FileProviders.Add(updateableFileProvider);
options.ViewLocationExpanders.Add(new NonMainPageViewLocationExpander());
#if NET451
options.ParseOptions = options.ParseOptions.WithPreprocessorSymbols("DNX451", "NET451_CUSTOM_DEFINE");
#if NET452
options.ParseOptions = options.ParseOptions.WithPreprocessorSymbols("NET452", "NET452_CUSTOM_DEFINE");
#endif
})
.AddViewOptions(options =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@inject FrameworkSpecificHelper MyHelper
@{
string value =
#if NET451_CUSTOM_DEFINE
MyHelper.ExecuteNet451Operation();
#if NET452_CUSTOM_DEFINE
MyHelper.ExecuteNet452Operation();
#endif
#if NETCOREAPP1_1_CUSTOM_DEFINE
MyHelper.ExecuteNetCoreApp1_0Operation();
MyHelper.ExecuteNetCoreApp1_1Operation();
#endif
}
@value
4 changes: 2 additions & 2 deletions test/WebSites/RazorWebSite/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
"Microsoft.Extensions.FileProviders.Embedded": "1.2.0-*"
},
"frameworks": {
"net451": {
"net452": {
"buildOptions": {
"define": [
"NET451_CUSTOM_DEFINE"
"NET452_CUSTOM_DEFINE"
]
}
},
Expand Down
2 changes: 1 addition & 1 deletion test/WebSites/RoutingWebSite/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"Microsoft.AspNetCore.StaticFiles": "1.2.0-*"
},
"frameworks": {
"net451": {},
"net452": {},
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
Expand Down
Loading

0 comments on commit 63507c8

Please sign in to comment.