-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d4ff93b
commit c042289
Showing
9 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
namespace Parsec.Tests.Shaiya.Cloak; | ||
|
||
public class CloakTests | ||
{ | ||
[Theory] | ||
[InlineData("CLOTH_TEXTHRE_DE.CTL")] | ||
[InlineData("CLOTH_TEXTHRE_EL.CTL")] | ||
[InlineData("CLOTH_TEXTHRE_HU.CTL")] | ||
[InlineData("CLOTH_TEXTHRE_VI.CTL")] | ||
public void CtlReadWriteTest(string fileName) | ||
{ | ||
var filePath = $"Shaiya/Cloak/{fileName}"; | ||
var jsonPath = $"Shaiya/Cloak/{fileName}.json"; | ||
var newObjPath = $"Shaiya/Cloak/new_{fileName}"; | ||
|
||
var obj = ParsecReader.FromFile<Parsec.Shaiya.Cloak.ClothTexture.Ctl>(filePath); | ||
|
||
obj.WriteJson(jsonPath); | ||
var objFromJson = ParsecReader.FromJsonFile<Parsec.Shaiya.Cloak.ClothTexture.Ctl>(jsonPath); | ||
|
||
// Check bytes | ||
Assert.Equal(obj.GetBytes(), objFromJson.GetBytes()); | ||
|
||
objFromJson.Write(newObjPath); | ||
var newObj = ParsecReader.FromFile<Parsec.Shaiya.Cloak.ClothTexture.Ctl>(newObjPath); | ||
|
||
// Check bytes | ||
Assert.Equal(obj.GetBytes(), newObj.GetBytes()); | ||
} | ||
|
||
[Theory] | ||
[InlineData("EmblemBack.dat")] | ||
[InlineData("EmblemFront.dat")] | ||
[InlineData("EmblemList.dat")] | ||
public void EmblemDatReadWriteTest(string fileName) | ||
{ | ||
var filePath = $"Shaiya/Cloak/{fileName}"; | ||
var jsonPath = $"Shaiya/Cloak/{fileName}.json"; | ||
var newObjPath = $"Shaiya/Cloak/new_{fileName}"; | ||
|
||
var obj = ParsecReader.FromFile<Parsec.Shaiya.Cloak.Emblem.EmblemDat>(filePath); | ||
|
||
obj.WriteJson(jsonPath); | ||
var objFromJson = ParsecReader.FromJsonFile<Parsec.Shaiya.Cloak.Emblem.EmblemDat>(jsonPath); | ||
|
||
// Check bytes | ||
Assert.Equal(obj.GetBytes(), objFromJson.GetBytes()); | ||
|
||
objFromJson.Write(newObjPath); | ||
var newObj = ParsecReader.FromFile<Parsec.Shaiya.Cloak.Emblem.EmblemDat>(newObjPath); | ||
|
||
// Check bytes | ||
Assert.Equal(obj.GetBytes(), newObj.GetBytes()); | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.