mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-18 16:33:24 +00:00
dccad6c2f4
Species and Nicknamed params were never used; foreign always resulted in true for cases when it actually mattered. Filter to the non-fullwidth characters, check the char type (latin base vs jp/zh/ko) in order to determine if the full/half symbols should be squished could be faster replacing char instead of string, so change those add two test cases for half width & full width string sanitization/unsanitization
36 lines
1.2 KiB
C#
36 lines
1.2 KiB
C#
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
using PKHeX.Core;
|
|
|
|
namespace PKHeX.Tests.Saves
|
|
{
|
|
[TestClass]
|
|
public class SMTests
|
|
{
|
|
public const string TestCategory = "SM Save Data Tests";
|
|
|
|
private SAV7 GetSave()
|
|
{
|
|
return new SAV7(Properties.Resources.SM_Project_802);
|
|
}
|
|
|
|
[TestMethod]
|
|
[TestCategory(TestCategory)]
|
|
public void TestChecksumRead()
|
|
{
|
|
Assert.IsTrue(GetSave().ChecksumsValid, "Checksums are not valid.");
|
|
}
|
|
|
|
[TestMethod]
|
|
[TestCategory(TestCategory)]
|
|
public void TestChecksumUpdate()
|
|
{
|
|
var save = GetSave();
|
|
var saveChecksumInfo = save.ChecksumInfo;
|
|
var newSave = new SAV7(save.Write(false, false));
|
|
Assert.AreEqual(saveChecksumInfo, save.ChecksumInfo, "Checksum info modified on Write");
|
|
Assert.IsTrue(save.ChecksumsValid, "Checksum not valid after write");
|
|
Assert.IsTrue(newSave.ChecksumsValid, "Checksums are not valid after open");
|
|
Assert.AreEqual(save.ChecksumInfo, newSave.ChecksumInfo, "Checksums changed since write and open");
|
|
}
|
|
}
|
|
}
|