Skip to content

Commit

Permalink
adjusted tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tolik518 committed Oct 22, 2023
1 parent 52b944f commit 6392f8d
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions SoG_SGreader.Test/IntegrationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,10 @@ private static string GetSaveGamePath(string saveGameNumber)
return Path.Combine(projectDirectory, "SoG_SGreader.Test", "SaveGames", saveGameNumber + ".cha");
}


[Fact]
public void TestSavegameTextOutput()
public void TestBadPath()
{
string arguments = "-t " + GetSaveGamePath("1");
string arguments = "-t " + GetSaveGamePath("doesntexist");

// Start the process
using var process = new Process
Expand All @@ -56,16 +55,14 @@ public void TestSavegameTextOutput()
string output = process.StandardOutput.ReadToEnd();
process.WaitForExit();

Assert.Contains("Filesize: 4494", output);
Assert.Contains("Birthday: 24.6.1081", output);
Assert.Contains("ItemsMetCount: 124", output);
Assert.Contains("KilledEnemiesCount: 58", output);
Assert.Contains("Could not find file", output);
Assert.Contains("SaveGames/doesntexist.cha", output);
}

[Fact]
public void TestSavegameJsonOutput()
public void TestTextOutput()
{
string arguments = "-j " + GetSaveGamePath("1");
string arguments = "-t " + GetSaveGamePath("1");

// Start the process
using var process = new Process
Expand All @@ -84,16 +81,16 @@ public void TestSavegameJsonOutput()
string output = process.StandardOutput.ReadToEnd();
process.WaitForExit();

Assert.Contains("\"MagicByte\": 116", output);
Assert.Contains("\"PlayTimeTotal\": 1645950", output);
Assert.Contains("\"UniquePlayerId\": 451873", output);
Assert.Contains("\"Cash\": 6873538", output);
Assert.Contains("Filesize: 4494", output);
Assert.Contains("Birthday: 24.6.1081", output);
Assert.Contains("ItemsMetCount: 124", output);
Assert.Contains("KilledEnemiesCount: 58", output);
}

[Fact]
public void TestPatchOutput()
public void TestJsonOutput()
{
string arguments = "--patch";
string arguments = "-j " + GetSaveGamePath("1");

// Start the process
using var process = new Process
Expand All @@ -112,13 +109,16 @@ public void TestPatchOutput()
string output = process.StandardOutput.ReadToEnd();
process.WaitForExit();

Assert.Contains(FrmMain.CurrentPatch, output);
Assert.Contains("\"MagicByte\": 116", output);
Assert.Contains("\"PlayTimeTotal\": 1645950", output);
Assert.Contains("\"UniquePlayerId\": 451873", output);
Assert.Contains("\"Cash\": 6873538", output);
}

[Fact]
public void TestHelpOutput()
public void TestPatchOutput()
{
string arguments = "--help";
string arguments = "--patch";

// Start the process
using var process = new Process
Expand All @@ -137,7 +137,7 @@ public void TestHelpOutput()
string output = process.StandardOutput.ReadToEnd();
process.WaitForExit();

Assert.Contains("--help", output);
Assert.Contains(FrmMain.CurrentPatch, output);
}
}
}

0 comments on commit 6392f8d

Please sign in to comment.