Skip to content

Commit

Permalink
change name in unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
DeathChaos25 committed Oct 20, 2024
1 parent 1e3a759 commit 5b5eb34
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Persona.Merger.Tests/P5RAssets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ public static class P5RAssets
public static readonly string VisualBefore = Path.Combine(AssetsFolder, "Visual", "Before", "VISUAL.TBL");
public static readonly string VisualAfter = Path.Combine(AssetsFolder, "Visual", "After", "VISUAL.TBL");
public static readonly string VisualAfter2 = Path.Combine(AssetsFolder, "Visual", "After2", "VISUAL.TBL");
public static readonly string VisualAfter3 = Path.Combine(AssetsFolder, "Visual", "After3", "VISUAL.TBL");
public static readonly string VisualExpected = Path.Combine(AssetsFolder, "Visual", "Expected", "VISUAL.TBL");

public static readonly string PDDBefore = Path.Combine(AssetsFolder, "PDD", "Before", "SHDPERSONAENEMY.PDD");
public static readonly string PDDAfter = Path.Combine(AssetsFolder, "PDD", "After", "SHDPERSONAENEMY.PDD");
public static readonly string PDDAfter2 = Path.Combine(AssetsFolder, "PDD", "After2", "SHDPERSONAENEMY.PDD");
public static readonly string PDDAfter3 = Path.Combine(AssetsFolder, "PDD", "After3", "SHDPERSONAENEMY.PDD");
public static readonly string PDDExpected = Path.Combine(AssetsFolder, "PDD", "Expected", "SHDPERSONAENEMY.PDD");
}
10 changes: 4 additions & 6 deletions Persona.Merger.Tests/Parser/P5RTblPatcherTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ public void PatchTbl_Generic()
var original = File.ReadAllBytes(P5RAssets.PDDBefore);
var after = File.ReadAllBytes(P5RAssets.PDDAfter);
var after2 = File.ReadAllBytes(P5RAssets.PDDAfter2);
var after3 = File.ReadAllBytes(P5RAssets.PDDAfter3);
var expected = File.ReadAllBytes(P5RAssets.PDDExpected);
var patcher = new GenericPatcher(original);
patches.Add(patcher.GeneratePatchGeneric(after, 4));
patches.Add(patcher.GeneratePatchGeneric(after2, 4));
var patched = patcher.ApplyGeneric(patches);

Assert.Equal(patched, after3);
Assert.Equal(patched, expected);
}

[Fact]
Expand All @@ -64,14 +64,12 @@ public void PatchTbl_VISUAL()
var original = File.ReadAllBytes(P5RAssets.VisualBefore);
var after = File.ReadAllBytes(P5RAssets.VisualAfter);
var after2 = File.ReadAllBytes(P5RAssets.VisualAfter2);
var after3 = File.ReadAllBytes(P5RAssets.VisualAfter3);
var expected = File.ReadAllBytes(P5RAssets.VisualExpected);
var patcher = new P5RTblPatcher(original, TblType.Visual);
patches.Add(patcher.GeneratePatch(after));
patches.Add(patcher.GeneratePatch(after2));
var patched = patcher.Apply(patches);

File.WriteAllBytes("D:\\Game Modding\\R2\\Loader\\VISUAL.TBL", patched);

Assert.Equal(patched, after3);
Assert.Equal(patched, expected);
}
}
2 changes: 1 addition & 1 deletion Persona.Merger.Tests/Persona.Merger.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<Folder Include="Assets\P5R\Visual\Before\" />
<Folder Include="Assets\P5R\Visual\After\" />
<Folder Include="Assets\P5R\Visual\After2\" />
<Folder Include="Assets\P5R\Visual\After3\" />
<Folder Include="Assets\P5R\Visual\Expected\" />
</ItemGroup>

</Project>

0 comments on commit 5b5eb34

Please sign in to comment.