React to resource changes

#59
This commit is contained in:
David Fowler 2014-06-25 23:48:19 -07:00
parent 97eda9d22e
commit e4911323a6
5 changed files with 6 additions and 17 deletions

View File

@ -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]

View File

@ -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);

View File

@ -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();

View File

@ -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()

View File

@ -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());
}