Skip to content

Commit

Permalink
fixed path yet again
Browse files Browse the repository at this point in the history
  • Loading branch information
tolik518 committed Oct 21, 2023
1 parent a1e51c5 commit 46c78da
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions SoG_SGreader.Test/DataReaderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,15 @@ private static Player GetSaveGame(int saveGameNumber)
{
DataReader dataReader = new DataReader();
var txtConsoleMock = new Mock<ITextBoxWrapper>().Object;

string projectDirectory = Environment.GetEnvironmentVariable("GITHUB_WORKSPACE") ?? Directory.GetParent(AppDomain.CurrentDomain.BaseDirectory).Parent.Parent.FullName;

string projectDirectory = Directory.GetParent(AppDomain.CurrentDomain.BaseDirectory).Parent.Parent.FullName;

// Exception for GitHub Actions Test Runner
if (Environment.GetEnvironmentVariable("GITHUB_WORKSPACE") != null)
{
projectDirectory = Directory.GetParent(Environment.GetEnvironmentVariable("GITHUB_WORKSPACE")).FullName;
}

string filePath = Path.Combine(projectDirectory, "..", "SoG_SGreader.Test", "SaveGames", saveGameNumber + ".cha");

return dataReader.ReadFromFile(filePath, txtConsoleMock);
Expand Down

0 comments on commit 46c78da

Please sign in to comment.