C#C
C#4mo ago
AizakkuIV

✅ Codes runs as expected, but Unit Test keeps failing

This is the unit test that keeps the helper methods from evaluating to green

[Fact]
public void SaveAndLoadGame()
{
    var fileName   = "TestGomoku.csv";
    var field      = InitAGame();
    var fieldSaved = (int[,])field.Clone();

    Gomoku.SaveGame(field, fileName);

    var csvImport   = new CsvImport<SavedGame>();
    var csvExported = csvImport.Read(fileName);

    csvExported.Should().HaveCount(Gomoku.GetStoneCount(field));

    field.Should().BeEquivalentTo(fieldSaved, "save must not change field");
    Gomoku.LoadGame(15, fileName).Should().BeEquivalentTo(field);
}


And this is the only error message provided
image.png
Was this page helpful?