From 4d0821f953ded0e7595591ed45b78a7bdb44df7a Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Mon, 27 Jul 2015 12:23:09 -0700 Subject: [PATCH] Transition Razor test comparers to new project. - Changed namespaces for test comparers. #461 --- Razor.sln | 9 +++- ...aseSensitiveTagHelperDescriptorComparer.cs | 4 +- .../Microsoft.AspNet.Razor.Test.Sources.xproj | 17 ++++++++ .../TagHelperAttributeDescriptorComparer.cs | 4 +- ...erAttributeDesignTimeDescriptorComparer.cs | 4 +- .../TagHelperDesignTimeDescriptorComparer.cs | 4 +- .../project.json | 13 ++++++ .../TagHelperDescriptorFactoryTest.cs | 1 + .../TagHelperDescriptorResolverTest.cs | 1 + ...agHelperDesignTimeDescriptorFactoryTest.cs | 1 + .../project.json | 4 ++ .../TagHelpers/TagHelperDescriptorTest.cs | 1 + .../TagHelperDesignTimeDescriptorComparer.cs | 41 ------------------- test/Microsoft.AspNet.Razor.Test/project.json | 4 ++ 14 files changed, 58 insertions(+), 50 deletions(-) rename {test/Microsoft.AspNet.Razor.Runtime.Test/TagHelpers => src/Microsoft.AspNet.Razor.Test.Sources}/CaseSensitiveTagHelperDescriptorComparer.cs (95%) create mode 100644 src/Microsoft.AspNet.Razor.Test.Sources/Microsoft.AspNet.Razor.Test.Sources.xproj rename {test/Microsoft.AspNet.Razor.Runtime.Test/TagHelpers => src/Microsoft.AspNet.Razor.Test.Sources}/TagHelperAttributeDescriptorComparer.cs (92%) rename {test/Microsoft.AspNet.Razor.Runtime.Test/TagHelpers => src/Microsoft.AspNet.Razor.Test.Sources}/TagHelperAttributeDesignTimeDescriptorComparer.cs (92%) rename {test/Microsoft.AspNet.Razor.Runtime.Test/TagHelpers => src/Microsoft.AspNet.Razor.Test.Sources}/TagHelperDesignTimeDescriptorComparer.cs (90%) create mode 100644 src/Microsoft.AspNet.Razor.Test.Sources/project.json delete mode 100644 test/Microsoft.AspNet.Razor.Test/TagHelpers/TagHelperDesignTimeDescriptorComparer.cs diff --git a/Razor.sln b/Razor.sln index 3642e70b8f..6a3d5b717a 100644 --- a/Razor.sln +++ b/Razor.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.22013.1 +VisualStudioVersion = 14.0.23107.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{3C0D6505-79B3-49D0-B4C3-176F0F1836ED}" EndProject @@ -15,6 +15,8 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Razor.Runt EndProject Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Razor.Runtime.Test", "test\Microsoft.AspNet.Razor.Runtime.Test\Microsoft.AspNet.Razor.Runtime.Test.xproj", "{0535998A-E32C-4D1A-80D1-0B15A513C471}" EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Razor.Test.Sources", "src\Microsoft.AspNet.Razor.Test.Sources\Microsoft.AspNet.Razor.Test.Sources.xproj", "{E3A2A305-634D-4BA6-95DB-AA06D6C442B0}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -37,6 +39,10 @@ Global {0535998A-E32C-4D1A-80D1-0B15A513C471}.Debug|Any CPU.Build.0 = Debug|Any CPU {0535998A-E32C-4D1A-80D1-0B15A513C471}.Release|Any CPU.ActiveCfg = Release|Any CPU {0535998A-E32C-4D1A-80D1-0B15A513C471}.Release|Any CPU.Build.0 = Release|Any CPU + {E3A2A305-634D-4BA6-95DB-AA06D6C442B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E3A2A305-634D-4BA6-95DB-AA06D6C442B0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E3A2A305-634D-4BA6-95DB-AA06D6C442B0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E3A2A305-634D-4BA6-95DB-AA06D6C442B0}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -46,5 +52,6 @@ Global {87C7338B-0C06-4C7B-BE75-A2368AE26797} = {92463391-81BE-462B-AC3C-78C6C760741F} {D0196096-1B01-4133-AACE-1A10A0F7247C} = {3C0D6505-79B3-49D0-B4C3-176F0F1836ED} {0535998A-E32C-4D1A-80D1-0B15A513C471} = {92463391-81BE-462B-AC3C-78C6C760741F} + {E3A2A305-634D-4BA6-95DB-AA06D6C442B0} = {3C0D6505-79B3-49D0-B4C3-176F0F1836ED} EndGlobalSection EndGlobal diff --git a/test/Microsoft.AspNet.Razor.Runtime.Test/TagHelpers/CaseSensitiveTagHelperDescriptorComparer.cs b/src/Microsoft.AspNet.Razor.Test.Sources/CaseSensitiveTagHelperDescriptorComparer.cs similarity index 95% rename from test/Microsoft.AspNet.Razor.Runtime.Test/TagHelpers/CaseSensitiveTagHelperDescriptorComparer.cs rename to src/Microsoft.AspNet.Razor.Test.Sources/CaseSensitiveTagHelperDescriptorComparer.cs index 5b3b8b43d4..27667fb473 100644 --- a/test/Microsoft.AspNet.Razor.Runtime.Test/TagHelpers/CaseSensitiveTagHelperDescriptorComparer.cs +++ b/src/Microsoft.AspNet.Razor.Test.Sources/CaseSensitiveTagHelperDescriptorComparer.cs @@ -6,9 +6,9 @@ using System.Linq; using Microsoft.AspNet.Razor.TagHelpers; using Microsoft.Internal.Web.Utils; -namespace Microsoft.AspNet.Razor.Runtime.TagHelpers +namespace Microsoft.AspNet.Razor.Test.Internal { - public class CaseSensitiveTagHelperDescriptorComparer : TagHelperDescriptorComparer + internal class CaseSensitiveTagHelperDescriptorComparer : TagHelperDescriptorComparer { public new static readonly CaseSensitiveTagHelperDescriptorComparer Default = new CaseSensitiveTagHelperDescriptorComparer(); diff --git a/src/Microsoft.AspNet.Razor.Test.Sources/Microsoft.AspNet.Razor.Test.Sources.xproj b/src/Microsoft.AspNet.Razor.Test.Sources/Microsoft.AspNet.Razor.Test.Sources.xproj new file mode 100644 index 0000000000..098eb77821 --- /dev/null +++ b/src/Microsoft.AspNet.Razor.Test.Sources/Microsoft.AspNet.Razor.Test.Sources.xproj @@ -0,0 +1,17 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + e3a2a305-634d-4ba6-95db-aa06d6c442b0 + ..\..\artifacts\obj\$(MSBuildProjectName) + ..\..\artifacts\bin\$(MSBuildProjectName)\ + + + 2.0 + + + \ No newline at end of file diff --git a/test/Microsoft.AspNet.Razor.Runtime.Test/TagHelpers/TagHelperAttributeDescriptorComparer.cs b/src/Microsoft.AspNet.Razor.Test.Sources/TagHelperAttributeDescriptorComparer.cs similarity index 92% rename from test/Microsoft.AspNet.Razor.Runtime.Test/TagHelpers/TagHelperAttributeDescriptorComparer.cs rename to src/Microsoft.AspNet.Razor.Test.Sources/TagHelperAttributeDescriptorComparer.cs index f0d6a93d15..0e98a78b88 100644 --- a/test/Microsoft.AspNet.Razor.Runtime.Test/TagHelpers/TagHelperAttributeDescriptorComparer.cs +++ b/src/Microsoft.AspNet.Razor.Test.Sources/TagHelperAttributeDescriptorComparer.cs @@ -6,9 +6,9 @@ using System.Collections.Generic; using Microsoft.AspNet.Razor.TagHelpers; using Microsoft.Internal.Web.Utils; -namespace Microsoft.AspNet.Razor.Runtime.TagHelpers +namespace Microsoft.AspNet.Razor.Test.Internal { - public class TagHelperAttributeDescriptorComparer : IEqualityComparer + internal class TagHelperAttributeDescriptorComparer : IEqualityComparer { public static readonly TagHelperAttributeDescriptorComparer Default = new TagHelperAttributeDescriptorComparer(); diff --git a/test/Microsoft.AspNet.Razor.Runtime.Test/TagHelpers/TagHelperAttributeDesignTimeDescriptorComparer.cs b/src/Microsoft.AspNet.Razor.Test.Sources/TagHelperAttributeDesignTimeDescriptorComparer.cs similarity index 92% rename from test/Microsoft.AspNet.Razor.Runtime.Test/TagHelpers/TagHelperAttributeDesignTimeDescriptorComparer.cs rename to src/Microsoft.AspNet.Razor.Test.Sources/TagHelperAttributeDesignTimeDescriptorComparer.cs index 345c6c4eef..3620410619 100644 --- a/test/Microsoft.AspNet.Razor.Runtime.Test/TagHelpers/TagHelperAttributeDesignTimeDescriptorComparer.cs +++ b/src/Microsoft.AspNet.Razor.Test.Sources/TagHelperAttributeDesignTimeDescriptorComparer.cs @@ -6,9 +6,9 @@ using System.Collections.Generic; using Microsoft.AspNet.Razor.TagHelpers; using Microsoft.Internal.Web.Utils; -namespace Microsoft.AspNet.Razor.Runtime.TagHelpers +namespace Microsoft.AspNet.Razor.Test.Internal { - public class TagHelperAttributeDesignTimeDescriptorComparer : + internal class TagHelperAttributeDesignTimeDescriptorComparer : IEqualityComparer { public static readonly TagHelperAttributeDesignTimeDescriptorComparer Default = diff --git a/test/Microsoft.AspNet.Razor.Runtime.Test/TagHelpers/TagHelperDesignTimeDescriptorComparer.cs b/src/Microsoft.AspNet.Razor.Test.Sources/TagHelperDesignTimeDescriptorComparer.cs similarity index 90% rename from test/Microsoft.AspNet.Razor.Runtime.Test/TagHelpers/TagHelperDesignTimeDescriptorComparer.cs rename to src/Microsoft.AspNet.Razor.Test.Sources/TagHelperDesignTimeDescriptorComparer.cs index cdf958ca93..2dd58ba12d 100644 --- a/test/Microsoft.AspNet.Razor.Runtime.Test/TagHelpers/TagHelperDesignTimeDescriptorComparer.cs +++ b/src/Microsoft.AspNet.Razor.Test.Sources/TagHelperDesignTimeDescriptorComparer.cs @@ -6,9 +6,9 @@ using System.Collections.Generic; using Microsoft.AspNet.Razor.TagHelpers; using Microsoft.Internal.Web.Utils; -namespace Microsoft.AspNet.Razor.Runtime.TagHelpers +namespace Microsoft.AspNet.Razor.Test.Internal { - public class TagHelperDesignTimeDescriptorComparer : IEqualityComparer + internal class TagHelperDesignTimeDescriptorComparer : IEqualityComparer { public static readonly TagHelperDesignTimeDescriptorComparer Default = new TagHelperDesignTimeDescriptorComparer(); diff --git a/src/Microsoft.AspNet.Razor.Test.Sources/project.json b/src/Microsoft.AspNet.Razor.Test.Sources/project.json new file mode 100644 index 0000000000..cbdb0937f9 --- /dev/null +++ b/src/Microsoft.AspNet.Razor.Test.Sources/project.json @@ -0,0 +1,13 @@ +{ + "version": "4.0.0-*", + "shared": "*.cs", + "dependencies": { }, + "frameworks": { + "net45": { }, + "dotnet": { + "dependencies": { + "System.Runtime": "4.0.20-*" + } + } + } +} diff --git a/test/Microsoft.AspNet.Razor.Runtime.Test/TagHelpers/TagHelperDescriptorFactoryTest.cs b/test/Microsoft.AspNet.Razor.Runtime.Test/TagHelpers/TagHelperDescriptorFactoryTest.cs index 392f0fac30..37bcfca618 100644 --- a/test/Microsoft.AspNet.Razor.Runtime.Test/TagHelpers/TagHelperDescriptorFactoryTest.cs +++ b/test/Microsoft.AspNet.Razor.Runtime.Test/TagHelpers/TagHelperDescriptorFactoryTest.cs @@ -7,6 +7,7 @@ using System.ComponentModel; using System.Linq; using System.Reflection; using Microsoft.AspNet.Razor.TagHelpers; +using Microsoft.AspNet.Razor.Test.Internal; using Xunit; namespace Microsoft.AspNet.Razor.Runtime.TagHelpers diff --git a/test/Microsoft.AspNet.Razor.Runtime.Test/TagHelpers/TagHelperDescriptorResolverTest.cs b/test/Microsoft.AspNet.Razor.Runtime.Test/TagHelpers/TagHelperDescriptorResolverTest.cs index 1d33177aa3..2f414830ae 100644 --- a/test/Microsoft.AspNet.Razor.Runtime.Test/TagHelpers/TagHelperDescriptorResolverTest.cs +++ b/test/Microsoft.AspNet.Razor.Runtime.Test/TagHelpers/TagHelperDescriptorResolverTest.cs @@ -7,6 +7,7 @@ using System.Linq; using System.Reflection; using Microsoft.AspNet.Razor.Parser; using Microsoft.AspNet.Razor.TagHelpers; +using Microsoft.AspNet.Razor.Test.Internal; using Xunit; namespace Microsoft.AspNet.Razor.Runtime.TagHelpers diff --git a/test/Microsoft.AspNet.Razor.Runtime.Test/TagHelpers/TagHelperDesignTimeDescriptorFactoryTest.cs b/test/Microsoft.AspNet.Razor.Runtime.Test/TagHelpers/TagHelperDesignTimeDescriptorFactoryTest.cs index 5a181a001e..42cd84fa1a 100644 --- a/test/Microsoft.AspNet.Razor.Runtime.Test/TagHelpers/TagHelperDesignTimeDescriptorFactoryTest.cs +++ b/test/Microsoft.AspNet.Razor.Runtime.Test/TagHelpers/TagHelperDesignTimeDescriptorFactoryTest.cs @@ -6,6 +6,7 @@ using System; using System.IO; using System.Reflection; using Microsoft.AspNet.Razor.TagHelpers; +using Microsoft.AspNet.Razor.Test.Internal; using Microsoft.AspNet.Testing; using Moq; using Xunit; diff --git a/test/Microsoft.AspNet.Razor.Runtime.Test/project.json b/test/Microsoft.AspNet.Razor.Runtime.Test/project.json index d2d865a7a3..b0b13a79cd 100644 --- a/test/Microsoft.AspNet.Razor.Runtime.Test/project.json +++ b/test/Microsoft.AspNet.Razor.Runtime.Test/project.json @@ -2,6 +2,10 @@ "version": "1.0.0", "dependencies": { "Microsoft.AspNet.Razor.Runtime": "4.0.0-*", + "Microsoft.AspNet.Razor.Test.Sources": { + "version": "4.0.0-*", + "type": "build" + }, "Microsoft.AspNet.Testing": "1.0.0-*", "Microsoft.Framework.WebEncoders.Testing": "1.0.0-*", "xunit.runner.aspnet": "2.0.0-aspnet-*" diff --git a/test/Microsoft.AspNet.Razor.Test/TagHelpers/TagHelperDescriptorTest.cs b/test/Microsoft.AspNet.Razor.Test/TagHelpers/TagHelperDescriptorTest.cs index 8b861bac4f..cbf5d983c8 100644 --- a/test/Microsoft.AspNet.Razor.Test/TagHelpers/TagHelperDescriptorTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/TagHelpers/TagHelperDescriptorTest.cs @@ -3,6 +3,7 @@ using System; using System.Linq; +using Microsoft.AspNet.Razor.Test.Internal; using Newtonsoft.Json; using Xunit; diff --git a/test/Microsoft.AspNet.Razor.Test/TagHelpers/TagHelperDesignTimeDescriptorComparer.cs b/test/Microsoft.AspNet.Razor.Test/TagHelpers/TagHelperDesignTimeDescriptorComparer.cs deleted file mode 100644 index 7e657edd0e..0000000000 --- a/test/Microsoft.AspNet.Razor.Test/TagHelpers/TagHelperDesignTimeDescriptorComparer.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 Microsoft.Internal.Web.Utils; - -namespace Microsoft.AspNet.Razor.TagHelpers -{ - public class TagHelperDesignTimeDescriptorComparer : IEqualityComparer - { - public static readonly TagHelperDesignTimeDescriptorComparer Default = - new TagHelperDesignTimeDescriptorComparer(); - - private TagHelperDesignTimeDescriptorComparer() - { - } - - public bool Equals(TagHelperDesignTimeDescriptor descriptorX, TagHelperDesignTimeDescriptor descriptorY) - { - if (descriptorX == descriptorY) - { - return true; - } - - return descriptorX != null && - descriptorY != null && - string.Equals(descriptorX.Summary, descriptorY.Summary, StringComparison.Ordinal) && - string.Equals(descriptorX.Remarks, descriptorY.Remarks, StringComparison.Ordinal); - } - - public int GetHashCode(TagHelperDesignTimeDescriptor descriptor) - { - return HashCodeCombiner - .Start() - .Add(descriptor.Summary, StringComparer.Ordinal) - .Add(descriptor.Remarks, StringComparer.Ordinal) - .CombinedHash; - } - } -} diff --git a/test/Microsoft.AspNet.Razor.Test/project.json b/test/Microsoft.AspNet.Razor.Test/project.json index d86b518d29..1ce74749a5 100644 --- a/test/Microsoft.AspNet.Razor.Test/project.json +++ b/test/Microsoft.AspNet.Razor.Test/project.json @@ -3,6 +3,10 @@ "resource": "TestFiles/**/*", "dependencies": { "Microsoft.AspNet.Razor": "4.0.0-*", + "Microsoft.AspNet.Razor.Test.Sources": { + "version": "4.0.0-*", + "type": "build" + }, "Microsoft.AspNet.Testing": "1.0.0-*", "xunit.runner.aspnet": "2.0.0-aspnet-*" },