Skip to content

Commit

Permalink
Handle working directory change during tests execution
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorFedchenko authored and Aaronontheweb committed Oct 28, 2019
1 parent 2044e8d commit 2ccc48b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/Incrementalist.Tests/Helpers/ProjectSampleGenerator.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.IO;

namespace Incrementalist.Tests.Helpers
Expand All @@ -12,8 +13,8 @@ public static class ProjectSampleGenerator
/// </summary>
public static ProjectWithImportSample GetProjectWithImportSample(string projectFileName)
{
var projectContent = File.ReadAllText("../../../Samples/ProjectFileWithImportSample.xml");
var importedPropsContent = File.ReadAllText("../../../Samples/ImportedPropsSample.xml");
var projectContent = File.ReadAllText(Path.Combine(AppContext.BaseDirectory, "../../../Samples/ProjectFileWithImportSample.xml"));
var importedPropsContent = File.ReadAllText(Path.Combine(AppContext.BaseDirectory, "../../../Samples/ImportedPropsSample.xml"));

return new ProjectWithImportSample(
new SampleFile(projectFileName, projectContent),
Expand All @@ -25,9 +26,9 @@ public static ProjectWithImportSample GetProjectWithImportSample(string projectF
/// </summary>
public static FSharpSampleSolution GetFSharpSolutionSample(string solutionName)
{
var solutionContent = File.ReadAllText("../../../Samples/FSharpSampleSolution/Solution.xml");
var fsharpProjectContent = File.ReadAllText("../../../Samples/FSharpSampleSolution/FSharpProject.xml");
var csharpProjectContent = File.ReadAllText("../../../Samples/FSharpSampleSolution/CSharpProject.xml");
var solutionContent = File.ReadAllText(Path.Combine(AppContext.BaseDirectory, "../../../Samples/FSharpSampleSolution/Solution.xml"));
var fsharpProjectContent = File.ReadAllText(Path.Combine(AppContext.BaseDirectory, "../../../Samples/FSharpSampleSolution/FSharpProject.xml"));
var csharpProjectContent = File.ReadAllText(Path.Combine(AppContext.BaseDirectory, "../../../Samples/FSharpSampleSolution/CSharpProject.xml"));

return new FSharpSampleSolution(
new SampleFile(solutionName, solutionContent),
Expand Down

0 comments on commit 2ccc48b

Please sign in to comment.