diff --git a/Tests/PKHeX.Tests/PKHeX.Tests.csproj b/Tests/PKHeX.Tests/PKHeX.Tests.csproj index b10ba501e..29e54e14f 100644 --- a/Tests/PKHeX.Tests/PKHeX.Tests.csproj +++ b/Tests/PKHeX.Tests/PKHeX.Tests.csproj @@ -77,7 +77,13 @@ + + True + True + Resources.resx + + @@ -94,6 +100,15 @@ + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + + diff --git a/Tests/PKHeX.Tests/Properties/Resources.Designer.cs b/Tests/PKHeX.Tests/Properties/Resources.Designer.cs new file mode 100644 index 000000000..b182833b8 --- /dev/null +++ b/Tests/PKHeX.Tests/Properties/Resources.Designer.cs @@ -0,0 +1,73 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace PKHeX.Tests.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PKHeX.Tests.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized resource of type System.Byte[]. + /// + internal static byte[] SM_Project_802 { + get { + object obj = ResourceManager.GetObject("SM_Project_802", resourceCulture); + return ((byte[])(obj)); + } + } + } +} diff --git a/Tests/PKHeX.Tests/Properties/Resources.resx b/Tests/PKHeX.Tests/Properties/Resources.resx new file mode 100644 index 000000000..ab6c59e50 --- /dev/null +++ b/Tests/PKHeX.Tests/Properties/Resources.resx @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\Resources\SM Project 802.main;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Tests/PKHeX.Tests/Resources/SM Project 802.main b/Tests/PKHeX.Tests/Resources/SM Project 802.main new file mode 100644 index 000000000..11b45b93b Binary files /dev/null and b/Tests/PKHeX.Tests/Resources/SM Project 802.main differ diff --git a/Tests/PKHeX.Tests/Saves/SMTests.cs b/Tests/PKHeX.Tests/Saves/SMTests.cs new file mode 100644 index 000000000..42052a353 --- /dev/null +++ b/Tests/PKHeX.Tests/Saves/SMTests.cs @@ -0,0 +1,38 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using PKHeX.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +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 newSave = new SAV7(save.Write(false, false)); + Assert.IsTrue(newSave.ChecksumsValid, "Checksums are not valid."); + Assert.AreEqual(save.ChecksumInfo, newSave.ChecksumInfo, "Checksums changed since saving without modification."); + } + } +}