From e4911323a6402da907cc46ca4a90c4aca9d9dd13 Mon Sep 17 00:00:00 2001 From: David Fowler Date: Wed, 25 Jun 2014 23:48:19 -0700 Subject: [PATCH] React to resource changes #59 --- .../Editor/RazorEditorParserTest.cs | 7 ++----- .../Generator/CodeTree/CSharpCodeBuilderTests.cs | 4 +--- .../Generator/RazorCodeGeneratorTest.cs | 8 ++------ .../Parser/Html/HtmlDocumentTest.cs | 2 +- test/Microsoft.AspNet.Razor.Test/Utils/TestFile.cs | 2 -- 5 files changed, 6 insertions(+), 17 deletions(-) diff --git a/test/Microsoft.AspNet.Razor.Test/Editor/RazorEditorParserTest.cs b/test/Microsoft.AspNet.Razor.Test/Editor/RazorEditorParserTest.cs index ec7d669e00..d398b7d295 100644 --- a/test/Microsoft.AspNet.Razor.Test/Editor/RazorEditorParserTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Editor/RazorEditorParserTest.cs @@ -18,11 +18,8 @@ namespace Microsoft.AspNet.Razor.Test.Editor { public class RazorEditorParserTest { - // TODO: When paths are preserved use these. - //private static readonly TestFile SimpleCSHTMLDocument = TestFile.Create("DesignTime.Simple.cshtml"); - //private static readonly TestFile SimpleCSHTMLDocumentGenerated = TestFile.Create("DesignTime.Simple.txt"); - private static readonly TestFile SimpleCSHTMLDocument = TestFile.Create("Simple.cshtml"); - private static readonly TestFile SimpleCSHTMLDocumentGenerated = TestFile.Create("Simple.txt"); + private static readonly TestFile SimpleCSHTMLDocument = TestFile.Create("TestFiles/DesignTime/Simple.cshtml"); + private static readonly TestFile SimpleCSHTMLDocumentGenerated = TestFile.Create("TestFiles/DesignTime/Simple.txt"); private const string TestLinePragmaFileName = "C:\\This\\Path\\Is\\Just\\For\\Line\\Pragmas.cshtml"; [Fact] diff --git a/test/Microsoft.AspNet.Razor.Test/Generator/CodeTree/CSharpCodeBuilderTests.cs b/test/Microsoft.AspNet.Razor.Test/Generator/CodeTree/CSharpCodeBuilderTests.cs index 0ae5657f3d..648a771150 100644 --- a/test/Microsoft.AspNet.Razor.Test/Generator/CodeTree/CSharpCodeBuilderTests.cs +++ b/test/Microsoft.AspNet.Razor.Test/Generator/CodeTree/CSharpCodeBuilderTests.cs @@ -27,9 +27,7 @@ namespace Microsoft.AspNet.Razor.Test.Generator.CodeTree BaselineWriter.WriteBaseline(@"test\Microsoft.AspNet.Razor.Test\TestFiles\CodeGenerator\CS\Output\CSharpCodeBuilder.cs", result.Code); - // TODO: When paths are preserved use this. - //var expectedOutput = TestFile.Create("CodeGenerator.CS.Output.CSharpCodeBuilder.cs").ReadAllText(); - var expectedOutput = TestFile.Create("CSharpCodeBuilder.cs").ReadAllText(); + var expectedOutput = TestFile.Create("TestFiles/CodeGenerator/CS/Output/CSharpCodeBuilder.cs").ReadAllText(); // Assert Assert.Equal(expectedOutput, result.Code); diff --git a/test/Microsoft.AspNet.Razor.Test/Generator/RazorCodeGeneratorTest.cs b/test/Microsoft.AspNet.Razor.Test/Generator/RazorCodeGeneratorTest.cs index 95e62108a2..a798413e58 100644 --- a/test/Microsoft.AspNet.Razor.Test/Generator/RazorCodeGeneratorTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Generator/RazorCodeGeneratorTest.cs @@ -99,13 +99,9 @@ namespace Microsoft.AspNet.Razor.Test.Generator baselineName = name; } - // TODO: When paths are preserved use these. - //string sourceLocation = string.Format("/CodeGenerator/{1}/Source/{0}.{2}", name, LanguageName, FileExtension); - //string source = TestFile.Create(string.Format("CodeGenerator.{1}.Source.{0}.{2}", name, LanguageName, FileExtension)).ReadAllText(); - //string expectedOutput = TestFile.Create(string.Format("CodeGenerator.{1}.Output.{0}.{2}", baselineName, LanguageName, BaselineExtension)).ReadAllText(); string sourceLocation = string.Format("/CodeGenerator/{1}/Source/{0}.{2}", name, LanguageName, FileExtension); - string source = TestFile.Create(string.Format("{0}.{1}", name, FileExtension)).ReadAllText(); - string expectedOutput = TestFile.Create(string.Format("{0}.{1}", baselineName, BaselineExtension)).ReadAllText(); + string source = TestFile.Create(string.Format("TestFiles/CodeGenerator/CS/Source/{0}.{1}", name, FileExtension)).ReadAllText(); + string expectedOutput = TestFile.Create(string.Format("TestFiles/CodeGenerator/CS/Output/{0}.{1}", baselineName, BaselineExtension)).ReadAllText(); // Set up the host and engine RazorEngineHost host = CreateHost(); diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlDocumentTest.cs b/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlDocumentTest.cs index e89d3f94f0..08ea639ae6 100644 --- a/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlDocumentTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlDocumentTest.cs @@ -13,7 +13,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.Html { public class HtmlDocumentTest : CsHtmlMarkupParserTestBase { - private static readonly TestFile Nested1000 = TestFile.Create("nested-1000.html"); + private static readonly TestFile Nested1000 = TestFile.Create("TestFiles/nested-1000.html"); [Fact] public void ParseDocumentMethodThrowsArgNullExceptionOnNullContext() diff --git a/test/Microsoft.AspNet.Razor.Test/Utils/TestFile.cs b/test/Microsoft.AspNet.Razor.Test/Utils/TestFile.cs index d6cc3de48d..4d429fdd1b 100644 --- a/test/Microsoft.AspNet.Razor.Test/Utils/TestFile.cs +++ b/test/Microsoft.AspNet.Razor.Test/Utils/TestFile.cs @@ -22,8 +22,6 @@ namespace Microsoft.AspNet.Razor.Test public static TestFile Create(string localResourceName) { - // TODO: When paths are preserved use this. - //return new TestFile(string.Format(ResourceNameFormat, Assembly.GetCallingAssembly().GetName().Name, localResourceName), Assembly.GetCallingAssembly()); return new TestFile(localResourceName, Assembly.GetCallingAssembly()); }