diff --git a/test/Microsoft.AspNetCore.Mvc.ApiExplorer.Test/project.json b/test/Microsoft.AspNetCore.Mvc.ApiExplorer.Test/project.json index fc389769e7..8197fd51ce 100644 --- a/test/Microsoft.AspNetCore.Mvc.ApiExplorer.Test/project.json +++ b/test/Microsoft.AspNetCore.Mvc.ApiExplorer.Test/project.json @@ -5,16 +5,10 @@ "dependencies": { "dotnet-test-xunit": "2.2.0-*", "Microsoft.AspNetCore.Mvc": "1.2.0-*", - "Microsoft.AspNetCore.Mvc.Formatters.Xml": "1.2.0-*", "Microsoft.AspNetCore.Mvc.TestCommon": { - "target": "project", - "type": "build" + "target": "project" }, - "Microsoft.AspNetCore.Testing": "1.2.0-*", - "Microsoft.DotNet.InternalAbstractions": "1.0.0", - "Microsoft.Extensions.Logging.Testing": "1.2.0-*", - "Moq": "4.6.36-*", - "xunit": "2.2.0-*" + "Microsoft.DotNet.InternalAbstractions": "1.0.0" }, "testRunner": "xunit", "frameworks": { diff --git a/test/Microsoft.AspNetCore.Mvc.Core.Test/project.json b/test/Microsoft.AspNetCore.Mvc.Core.Test/project.json index 0971344a32..c2612d6e49 100644 --- a/test/Microsoft.AspNetCore.Mvc.Core.Test/project.json +++ b/test/Microsoft.AspNetCore.Mvc.Core.Test/project.json @@ -8,24 +8,19 @@ "dotnet-test-xunit": "2.2.0-*", "Microsoft.AspNetCore.Http": "1.2.0-*", "Microsoft.AspNetCore.Mvc": "1.2.0-*", - "Microsoft.AspNetCore.Mvc.Formatters.Xml": "1.2.0-*", "Microsoft.AspNetCore.Mvc.TestCommon": { - "target": "project", - "type": "build" + "target": "project" }, "Microsoft.AspNetCore.Mvc.TestDiagnosticListener.Sources": { "target": "project", "type": "build" }, "Microsoft.AspNetCore.ResponseCaching": "1.0.0-*", - "Microsoft.AspNetCore.Testing": "1.2.0-*", "Microsoft.DotNet.InternalAbstractions": "1.0.0", "Microsoft.Extensions.DependencyInjection": "1.2.0-*", "Microsoft.Extensions.DiagnosticAdapter": "1.2.0-*", "Microsoft.Extensions.Logging": "1.2.0-*", - "Microsoft.Extensions.Logging.Testing": "1.2.0-*", - "Moq": "4.6.36-*", - "xunit": "2.2.0-*" + "Microsoft.Extensions.Logging.Testing": "1.2.0-*" }, "testRunner": "xunit", "frameworks": { diff --git a/test/Microsoft.AspNetCore.Mvc.Cors.Test/project.json b/test/Microsoft.AspNetCore.Mvc.Cors.Test/project.json index 71f84c3945..736ac5baf0 100644 --- a/test/Microsoft.AspNetCore.Mvc.Cors.Test/project.json +++ b/test/Microsoft.AspNetCore.Mvc.Cors.Test/project.json @@ -5,18 +5,13 @@ "dependencies": { "dotnet-test-xunit": "2.2.0-*", "Microsoft.AspNetCore.Http": "1.2.0-*", - "Microsoft.AspNetCore.Mvc": "1.2.0-*", - "Microsoft.AspNetCore.Mvc.Formatters.Xml": "1.2.0-*", + "Microsoft.AspNetCore.Mvc.Cors": "1.2.0-*", "Microsoft.AspNetCore.Mvc.TestCommon": { - "target": "project", - "type": "build" + "target": "project" }, - "Microsoft.AspNetCore.Testing": "1.2.0-*", "Microsoft.DotNet.InternalAbstractions": "1.0.0", "Microsoft.Extensions.DependencyInjection": "1.2.0-*", - "Microsoft.Extensions.Logging.Testing": "1.2.0-*", - "Moq": "4.6.36-*", - "xunit": "2.2.0-*" + "Microsoft.Extensions.Logging.Testing": "1.2.0-*" }, "testRunner": "xunit", "frameworks": { diff --git a/test/Microsoft.AspNetCore.Mvc.DataAnnotations.Test/project.json b/test/Microsoft.AspNetCore.Mvc.DataAnnotations.Test/project.json index d58f71cb90..06f49dbfc4 100644 --- a/test/Microsoft.AspNetCore.Mvc.DataAnnotations.Test/project.json +++ b/test/Microsoft.AspNetCore.Mvc.DataAnnotations.Test/project.json @@ -5,22 +5,16 @@ }, "dependencies": { "dotnet-test-xunit": "2.2.0-*", - "Microsoft.AspNetCore.Mvc": "1.2.0-*", - "Microsoft.AspNetCore.Mvc.Formatters.Xml": "1.2.0-*", "Microsoft.AspNetCore.Mvc.TestCommon": { - "target": "project", - "type": "build" + "target": "project" }, - "Microsoft.AspNetCore.Testing": "1.2.0-*", "Microsoft.DotNet.InternalAbstractions": "1.0.0", "Microsoft.Extensions.DependencyInjection": "1.2.0-*", "Microsoft.Extensions.HashCodeCombiner.Sources": { "version": "1.2.0-*", "type": "build" }, - "Microsoft.Extensions.Logging.Testing": "1.2.0-*", - "Moq": "4.6.36-*", - "xunit": "2.2.0-*" + "Microsoft.Extensions.Logging.Testing": "1.2.0-*" }, "testRunner": "xunit", "frameworks": { diff --git a/test/Microsoft.AspNetCore.Mvc.Formatters.Json.Test/project.json b/test/Microsoft.AspNetCore.Mvc.Formatters.Json.Test/project.json index 71f84c3945..28bd904fbf 100644 --- a/test/Microsoft.AspNetCore.Mvc.Formatters.Json.Test/project.json +++ b/test/Microsoft.AspNetCore.Mvc.Formatters.Json.Test/project.json @@ -5,18 +5,13 @@ "dependencies": { "dotnet-test-xunit": "2.2.0-*", "Microsoft.AspNetCore.Http": "1.2.0-*", - "Microsoft.AspNetCore.Mvc": "1.2.0-*", - "Microsoft.AspNetCore.Mvc.Formatters.Xml": "1.2.0-*", "Microsoft.AspNetCore.Mvc.TestCommon": { - "target": "project", - "type": "build" + "target": "project" }, "Microsoft.AspNetCore.Testing": "1.2.0-*", "Microsoft.DotNet.InternalAbstractions": "1.0.0", "Microsoft.Extensions.DependencyInjection": "1.2.0-*", - "Microsoft.Extensions.Logging.Testing": "1.2.0-*", - "Moq": "4.6.36-*", - "xunit": "2.2.0-*" + "Microsoft.Extensions.Logging.Testing": "1.2.0-*" }, "testRunner": "xunit", "frameworks": { diff --git a/test/Microsoft.AspNetCore.Mvc.Formatters.Xml.Test/project.json b/test/Microsoft.AspNetCore.Mvc.Formatters.Xml.Test/project.json index a45af2cc52..083b388692 100644 --- a/test/Microsoft.AspNetCore.Mvc.Formatters.Xml.Test/project.json +++ b/test/Microsoft.AspNetCore.Mvc.Formatters.Xml.Test/project.json @@ -6,16 +6,10 @@ "dependencies": { "dotnet-test-xunit": "2.2.0-*", "Microsoft.AspNetCore.Http": "1.2.0-*", - "Microsoft.AspNetCore.Mvc": "1.2.0-*", - "Microsoft.AspNetCore.Mvc.Formatters.Xml": "1.2.0-*", "Microsoft.AspNetCore.Mvc.TestCommon": { - "target": "project", - "type": "build" + "target": "project" }, - "Microsoft.AspNetCore.Testing": "1.2.0-*", - "Microsoft.DotNet.InternalAbstractions": "1.0.0", - "Moq": "4.6.36-*", - "xunit": "2.2.0-*" + "Microsoft.DotNet.InternalAbstractions": "1.0.0" }, "testRunner": "xunit", "frameworks": { diff --git a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/project.json b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/project.json index 2d35509383..bf5c509345 100644 --- a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/project.json +++ b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/project.json @@ -10,44 +10,80 @@ "warningsAsErrors": true }, "dependencies": { - "SecurityWebSite": "1.0.0", - "ApiExplorerWebSite": "1.0.0", - "ApplicationModelWebSite": "1.0.0", - "BasicWebSite": "1.0.0", - "ControllersFromServicesWebSite": "1.0.0", - "CorsWebSite": "1.0.0", + "ApiExplorerWebSite": { + "target": "project" + }, + "ApplicationModelWebSite": { + "target": "project" + }, + "BasicWebSite": { + "target": "project" + }, + "ControllersFromServicesWebSite": { + "target": "project" + }, + "CorsWebSite": { + "target": "project" + }, "dotnet-test-xunit": "2.2.0-*", - "ErrorPageMiddlewareWebSite": "1.0.0", - "FilesWebSite": "1.0.0", - "FiltersWebSite": "1.0.0", - "FormatterWebSite": "1.0.0", - "HtmlGenerationWebSite": "1.0.0", + "ErrorPageMiddlewareWebSite": { + "target": "project" + }, + "FilesWebSite": { + "target": "project" + }, + "FiltersWebSite": { + "target": "project" + }, + "FormatterWebSite": { + "target": "project" + }, + "HtmlGenerationWebSite": { + "target": "project" + }, "Microsoft.AspNetCore.ChunkingCookieManager.Sources": { "version": "1.2.0-*", "type": "build" }, - "Microsoft.AspNetCore.Mvc": "1.2.0-*", - "Microsoft.AspNetCore.Mvc.Formatters.Xml": "1.2.0-*", "Microsoft.AspNetCore.Mvc.TestCommon": { "target": "project", "type": "build" }, - "Microsoft.AspNetCore.Mvc.TestConfiguration": "1.0.0", "Microsoft.AspNetCore.TestHost": "1.2.0-*", "Microsoft.AspNetCore.WebUtilities": "1.2.0-*", "Microsoft.DotNet.InternalAbstractions": "1.0.0", "Microsoft.Extensions.Configuration.Json": "1.2.0-*", "Microsoft.Extensions.Logging.Testing": "1.2.0-*", - "MvcSandbox": "1.0.0", - "RazorPageExecutionInstrumentationWebSite": "1.0.0", - "RazorWebSite": "1.0.0", - "RoutingWebSite": "1.0.0", - "SimpleWebSite": "1.0.0", - "TagHelpersWebSite": "1.0.0", - "VersioningWebSite": "1.0.0", - "WebApiCompatShimWebSite": "1.0.0", - "XmlFormattersWebSite": "1.0.0", - "xunit": "2.2.0-*" + "MvcSandbox": { + "target": "project" + }, + "RazorPageExecutionInstrumentationWebSite": { + "target": "project" + }, + "RazorWebSite": { + "target": "project" + }, + "RoutingWebSite": { + "target": "project" + }, + "SecurityWebSite": { + "target": "project" + }, + "SimpleWebSite": { + "target": "project" + }, + "TagHelpersWebSite": { + "target": "project" + }, + "VersioningWebSite": { + "target": "project" + }, + "WebApiCompatShimWebSite": { + "target": "project" + }, + "XmlFormattersWebSite": { + "target": "project" + } }, "testRunner": "xunit", "frameworks": { diff --git a/test/Microsoft.AspNetCore.Mvc.IntegrationTests/project.json b/test/Microsoft.AspNetCore.Mvc.IntegrationTests/project.json index 35213f847f..81846dffb6 100644 --- a/test/Microsoft.AspNetCore.Mvc.IntegrationTests/project.json +++ b/test/Microsoft.AspNetCore.Mvc.IntegrationTests/project.json @@ -6,16 +6,11 @@ "dotnet-test-xunit": "2.2.0-*", "Microsoft.AspNetCore.Http": "1.2.0-*", "Microsoft.AspNetCore.Mvc": "1.2.0-*", - "Microsoft.AspNetCore.Mvc.Formatters.Xml": "1.2.0-*", "Microsoft.AspNetCore.Mvc.TestCommon": { - "target": "project", - "type": "build" + "target": "project" }, - "Microsoft.AspNetCore.Testing": "1.2.0-*", "Microsoft.DotNet.InternalAbstractions": "1.0.0", - "Microsoft.Extensions.Logging": "1.2.0-*", - "Moq": "4.6.36-*", - "xunit": "2.2.0-*" + "Microsoft.Extensions.Logging": "1.2.0-*" }, "testRunner": "xunit", "frameworks": { diff --git a/test/Microsoft.AspNetCore.Mvc.Localization.Test/project.json b/test/Microsoft.AspNetCore.Mvc.Localization.Test/project.json index 24854400c2..961475aed5 100644 --- a/test/Microsoft.AspNetCore.Mvc.Localization.Test/project.json +++ b/test/Microsoft.AspNetCore.Mvc.Localization.Test/project.json @@ -5,11 +5,8 @@ "dependencies": { "dotnet-test-xunit": "2.2.0-*", "Microsoft.AspNetCore.Mvc": "1.2.0-*", - "Microsoft.AspNetCore.Mvc.Formatters.Xml": "1.2.0-*", - "Microsoft.AspNetCore.Mvc.Localization": "1.2.0-*", "Microsoft.AspNetCore.Mvc.TestCommon": { - "target": "project", - "type": "build" + "target": "project" }, "Microsoft.AspNetCore.Testing": "1.2.0-*", "Microsoft.DotNet.InternalAbstractions": "1.0.0", diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/Directives/ChunkInheritanceUtilityTest.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/Directives/ChunkInheritanceUtilityTest.cs index f4debb6bf2..115a2612d6 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/Directives/ChunkInheritanceUtilityTest.cs +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/Directives/ChunkInheritanceUtilityTest.cs @@ -1,6 +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. +using System.IO; using Microsoft.AspNetCore.Razor.Chunks; using Microsoft.AspNetCore.Razor.Runtime.TagHelpers; using Xunit; @@ -37,7 +38,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Directives // Act var chunkTreeResults = utility.GetInheritedChunkTreeResults( - PlatformNormalizer.NormalizePath(@"Views\home\Index.cshtml")); + Path.Combine("Views", "home", "Index.cshtml")); // Assert Assert.Collection(chunkTreeResults, @@ -127,7 +128,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Directives var utility = new ChunkInheritanceUtility(host, cache, defaultChunks); // Act - var chunkTrees = utility.GetInheritedChunkTreeResults(PlatformNormalizer.NormalizePath(@"Views\home\Index.cshtml")); + var chunkTrees = utility.GetInheritedChunkTreeResults(Path.Combine("Views", "home", "Index.cshtml")); // Assert Assert.Empty(chunkTrees); diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/project.json b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/project.json index afdfb56edb..146d806428 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/project.json +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/project.json @@ -1,16 +1,10 @@ { "dependencies": { "dotnet-test-xunit": "2.2.0-*", - "Microsoft.AspNetCore.Mvc.Core": "1.2.0-*", - "Microsoft.AspNetCore.Mvc.DataAnnotations": "1.2.0-*", - "Microsoft.AspNetCore.Mvc.Formatters.Xml": "1.2.0-*", "Microsoft.AspNetCore.Mvc.Razor": "1.2.0-*", - "Microsoft.AspNetCore.Mvc.Razor.Host": "1.2.0-*", "Microsoft.AspNetCore.Mvc.TestCommon": { - "target": "project", - "type": "build" + "target": "project" }, - "Microsoft.AspNetCore.Mvc.ViewFeatures": "1.2.0-*", "Microsoft.AspNetCore.Testing": "1.2.0-*", "Microsoft.DotNet.InternalAbstractions": "1.0.0", "Moq": "4.6.36-*", diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Test/project.json b/test/Microsoft.AspNetCore.Mvc.Razor.Test/project.json index bb1d46b75e..3c7270f2e8 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Test/project.json +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Test/project.json @@ -3,14 +3,6 @@ "preserveCompilationContext": true, "warningsAsErrors": true, "keyFile": "../../tools/Key.snk", - "compile": { - "include": [ - "../Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFileProvider.cs", - "../Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFileInfo.cs", - "../Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFileTrigger.cs", - "../Microsoft.AspNetCore.Mvc.ViewFeatures.Test/Internal/TestViewBufferScope.cs" - ] - }, "define": [ "SOME_TEST_DEFINE" ] @@ -19,28 +11,21 @@ "dotnet-test-xunit": "2.2.0-*", "Microsoft.AspNetCore.Http": "1.2.0-*", "Microsoft.AspNetCore.Mvc": "1.2.0-*", - "Microsoft.AspNetCore.Mvc.DataAnnotations": "1.2.0-*", - "Microsoft.AspNetCore.Mvc.Formatters.Xml": "1.2.0-*", - "Microsoft.AspNetCore.Mvc.Razor": "1.2.0-*", "Microsoft.AspNetCore.Razor.TagHelpers.Testing.Sources": { "version": "1.2.0-*", "type": "build" }, "Microsoft.AspNetCore.Mvc.TestCommon": { - "target": "project", - "type": "build" + "target": "project" }, "Microsoft.AspNetCore.Mvc.TestDiagnosticListener.Sources": { "target": "project", "type": "build" }, - "Microsoft.AspNetCore.Testing": "1.2.0-*", "Microsoft.DotNet.InternalAbstractions": "1.0.0", "Microsoft.Extensions.DependencyInjection": "1.2.0-*", "Microsoft.Extensions.DiagnosticAdapter": "1.2.0-*", - "Microsoft.Extensions.Logging.Testing": "1.2.0-*", - "Moq": "4.6.36-*", - "xunit": "2.2.0-*" + "Microsoft.Extensions.Logging.Testing": "1.2.0-*" }, "testRunner": "xunit", "frameworks": { diff --git a/test/Microsoft.AspNetCore.Mvc.RazorPages.Test/project.json b/test/Microsoft.AspNetCore.Mvc.RazorPages.Test/project.json index 0273dadfad..94cac77a2c 100644 --- a/test/Microsoft.AspNetCore.Mvc.RazorPages.Test/project.json +++ b/test/Microsoft.AspNetCore.Mvc.RazorPages.Test/project.json @@ -4,7 +4,7 @@ }, "dependencies": { "dotnet-test-xunit": "2.2.0-*", - "Microsoft.AspNetCore.Testing": "1.1.0-*", + "Microsoft.AspNetCore.Testing": "1.2.0-*", "Microsoft.DotNet.InternalAbstractions": "1.0.0", "Moq": "4.6.36-*", "xunit": "2.2.0-*" diff --git a/test/Microsoft.AspNetCore.Mvc.TagHelpers.Test/project.json b/test/Microsoft.AspNetCore.Mvc.TagHelpers.Test/project.json index 1229e534ab..58c627571b 100644 --- a/test/Microsoft.AspNetCore.Mvc.TagHelpers.Test/project.json +++ b/test/Microsoft.AspNetCore.Mvc.TagHelpers.Test/project.json @@ -6,12 +6,9 @@ "dependencies": { "dotnet-test-xunit": "2.2.0-*", "Microsoft.AspNetCore.Http": "1.2.0-*", - "Microsoft.AspNetCore.Mvc.DataAnnotations": "1.2.0-*", - "Microsoft.AspNetCore.Mvc.Formatters.Xml": "1.2.0-*", "Microsoft.AspNetCore.Mvc.TagHelpers": "1.2.0-*", "Microsoft.AspNetCore.Mvc.TestCommon": { - "target": "project", - "type": "build" + "target": "project" }, "Microsoft.AspNetCore.Razor.TagHelpers.Testing.Sources": { "version": "1.2.0-*", diff --git a/test/Microsoft.AspNetCore.Mvc.TestCommon/CommonFilterTest.cs b/test/Microsoft.AspNetCore.Mvc.TestCommon/CommonFilterTest.cs index 233838f250..da12a53473 100644 --- a/test/Microsoft.AspNetCore.Mvc.TestCommon/CommonFilterTest.cs +++ b/test/Microsoft.AspNetCore.Mvc.TestCommon/CommonFilterTest.cs @@ -1,7 +1,6 @@ // 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 !FUNCTIONAL_TESTS using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; @@ -238,4 +237,3 @@ namespace Microsoft.AspNetCore.Mvc.Filters } } } -#endif diff --git a/test/Microsoft.AspNetCore.Mvc.TestCommon/PlatformNormalizer.cs b/test/Microsoft.AspNetCore.Mvc.TestCommon/PlatformNormalizer.cs index d825309ef7..f74ee505f2 100644 --- a/test/Microsoft.AspNetCore.Mvc.TestCommon/PlatformNormalizer.cs +++ b/test/Microsoft.AspNetCore.Mvc.TestCommon/PlatformNormalizer.cs @@ -1,12 +1,11 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// 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.IO; using System.Text.RegularExpressions; -using Microsoft.AspNetCore.Testing; using Microsoft.AspNetCore.Razor; +using Microsoft.AspNetCore.Testing; namespace Microsoft.AspNetCore.Mvc { @@ -44,17 +43,6 @@ namespace Microsoft.AspNetCore.Mvc return input; } - // Each new line character is returned as "_". - public static string GetNewLinesAsUnderscores(int numberOfNewLines) - { - return new string('_', numberOfNewLines * Environment.NewLine.Length); - } - - public static string NormalizePath(string path) - { - return path.Replace('\\', Path.DirectorySeparatorChar); - } - // Assuming windows based source location is passed in, // it gets normalized to other platforms. public static SourceLocation NormalizedSourceLocation(int absoluteIndex, int lineIndex, int characterIndex) @@ -63,5 +51,5 @@ namespace Microsoft.AspNetCore.Mvc var differenceInLength = windowsNewLineLength - Environment.NewLine.Length; return new SourceLocation(absoluteIndex - (differenceInLength * lineIndex), lineIndex, characterIndex); } - } + } } \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.Mvc.TestCommon/TestClientModelValidatorProvider.cs b/test/Microsoft.AspNetCore.Mvc.TestCommon/TestClientModelValidatorProvider.cs index b1dfda386f..3a6a978ff5 100644 --- a/test/Microsoft.AspNetCore.Mvc.TestCommon/TestClientModelValidatorProvider.cs +++ b/test/Microsoft.AspNetCore.Mvc.TestCommon/TestClientModelValidatorProvider.cs @@ -7,7 +7,7 @@ using Microsoft.AspNetCore.Mvc.DataAnnotations.Internal; namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation { - internal class TestClientModelValidatorProvider : CompositeClientModelValidatorProvider + public class TestClientModelValidatorProvider : CompositeClientModelValidatorProvider { // Creates a provider with all the defaults - includes data annotations public static IClientModelValidatorProvider CreateDefaultProvider() diff --git a/test/Microsoft.AspNetCore.Mvc.TestCommon/TestModelMetadataProvider.cs b/test/Microsoft.AspNetCore.Mvc.TestCommon/TestModelMetadataProvider.cs index ef5b220eab..360baf953b 100644 --- a/test/Microsoft.AspNetCore.Mvc.TestCommon/TestModelMetadataProvider.cs +++ b/test/Microsoft.AspNetCore.Mvc.TestCommon/TestModelMetadataProvider.cs @@ -13,7 +13,7 @@ using Xunit; namespace Microsoft.AspNetCore.Mvc.ModelBinding { - internal class TestModelMetadataProvider : DefaultModelMetadataProvider + public class TestModelMetadataProvider : DefaultModelMetadataProvider { // Creates a provider with all the defaults - includes data annotations public static IModelMetadataProvider CreateDefaultProvider(IStringLocalizerFactory stringLocalizerFactory = null) diff --git a/test/Microsoft.AspNetCore.Mvc.TestCommon/TestModelValidatorProvider.cs b/test/Microsoft.AspNetCore.Mvc.TestCommon/TestModelValidatorProvider.cs index 9e9d77dd1d..0ec6fc7363 100644 --- a/test/Microsoft.AspNetCore.Mvc.TestCommon/TestModelValidatorProvider.cs +++ b/test/Microsoft.AspNetCore.Mvc.TestCommon/TestModelValidatorProvider.cs @@ -8,7 +8,7 @@ using Microsoft.AspNetCore.Mvc.Internal; namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation { - internal class TestModelValidatorProvider : CompositeModelValidatorProvider + public class TestModelValidatorProvider : CompositeModelValidatorProvider { // Creates a provider with all the defaults - includes data annotations public static CompositeModelValidatorProvider CreateDefaultProvider() diff --git a/test/Microsoft.AspNetCore.Mvc.ViewFeatures.Test/Internal/TestViewBufferScope.cs b/test/Microsoft.AspNetCore.Mvc.TestCommon/TestViewBufferScope.cs similarity index 100% rename from test/Microsoft.AspNetCore.Mvc.ViewFeatures.Test/Internal/TestViewBufferScope.cs rename to test/Microsoft.AspNetCore.Mvc.TestCommon/TestViewBufferScope.cs diff --git a/test/Microsoft.AspNetCore.Mvc.TestCommon/ValidationAttributeUtil.cs b/test/Microsoft.AspNetCore.Mvc.TestCommon/ValidationAttributeUtil.cs index fee40f77e1..20da144e20 100644 --- a/test/Microsoft.AspNetCore.Mvc.TestCommon/ValidationAttributeUtil.cs +++ b/test/Microsoft.AspNetCore.Mvc.TestCommon/ValidationAttributeUtil.cs @@ -24,12 +24,6 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding return attr.FormatErrorMessage(field); } - public static string GetMaxLengthErrorMessage(int maximumLength, string field) - { - var attr = new MaxLengthAttribute(maximumLength); - return attr.FormatErrorMessage(field); - } - public static string GetRegExErrorMessage(string pattern, string field) { var attr = new RegularExpressionAttribute(pattern); diff --git a/test/Microsoft.AspNetCore.Mvc.TestCommon/project.json b/test/Microsoft.AspNetCore.Mvc.TestCommon/project.json index f6e0dd7ce7..0c24622a8d 100644 --- a/test/Microsoft.AspNetCore.Mvc.TestCommon/project.json +++ b/test/Microsoft.AspNetCore.Mvc.TestCommon/project.json @@ -1,11 +1,27 @@ { - "shared": "**/*.cs", + "buildOptions": { + "warningsAsErrors": true, + "keyFile": "../../tools/Key.snk" + }, "frameworks": { "net451": {}, - "netstandard1.3": { + "netstandard1.6": { "dependencies": { - "NETStandard.Library": "1.6.1-*" + "System.ComponentModel.Annotations": "4.3.0" } } + }, + "dependencies": { + "Microsoft.AspNetCore.Html.Abstractions": "1.2.0-*", + "Microsoft.AspNetCore.Mvc.Formatters.Xml": "1.2.0-*", + "Microsoft.AspNetCore.Mvc.ViewFeatures": "1.2.0-*", + "Microsoft.AspNetCore.Razor": "1.2.0-*", + "Microsoft.AspNetCore.Testing": "1.2.0-*", + "Microsoft.Extensions.FileProviders.Abstractions": "1.2.0-*", + "Microsoft.Extensions.Options": "1.2.0-*", + "Microsoft.Extensions.WebEncoders": "1.2.0-*", + "Moq": "4.6.36-*", + "NETStandard.Library": "1.6.1-*", + "xunit": "2.2.0-*" } } \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.Mvc.ViewFeatures.Test/project.json b/test/Microsoft.AspNetCore.Mvc.ViewFeatures.Test/project.json index 9550be9444..0019b197ad 100644 --- a/test/Microsoft.AspNetCore.Mvc.ViewFeatures.Test/project.json +++ b/test/Microsoft.AspNetCore.Mvc.ViewFeatures.Test/project.json @@ -7,23 +7,17 @@ "dotnet-test-xunit": "2.2.0-*", "Microsoft.AspNetCore.Http": "1.2.0-*", "Microsoft.AspNetCore.Mvc": "1.2.0-*", - "Microsoft.AspNetCore.Mvc.Formatters.Xml": "1.2.0-*", "Microsoft.AspNetCore.Mvc.TestCommon": { - "target": "project", - "type": "build" + "target": "project" }, "Microsoft.AspNetCore.Mvc.TestDiagnosticListener.Sources": { "target": "project", "type": "build" }, - "Microsoft.AspNetCore.Mvc.ViewFeatures": "1.2.0-*", - "Microsoft.AspNetCore.Testing": "1.2.0-*", "Microsoft.DotNet.InternalAbstractions": "1.0.0", "Microsoft.Extensions.DependencyInjection": "1.2.0-*", "Microsoft.Extensions.DiagnosticAdapter": "1.2.0-*", - "Microsoft.Extensions.Logging.Testing": "1.2.0-*", - "Moq": "4.6.36-*", - "xunit": "2.2.0-*" + "Microsoft.Extensions.Logging.Testing": "1.2.0-*" }, "testRunner": "xunit", "frameworks": {