diff --git a/PKHeX.Core/Legality/Encounters/EncounterTrade.cs b/PKHeX.Core/Legality/Encounters/EncounterTrade.cs index 225c45df9..25f710fe2 100644 --- a/PKHeX.Core/Legality/Encounters/EncounterTrade.cs +++ b/PKHeX.Core/Legality/Encounters/EncounterTrade.cs @@ -74,7 +74,7 @@ public PKM ConvertToPKM(ITrainerInfo SAV) int level = CurrentLevel > 0 ? CurrentLevel : LevelMin; if (level == 0) level = 25; // avoid some cases - var pk = PKMConverter.GetBlank(SAV); + var pk = PKMConverter.GetBlank(SAV.GetType()); pk.EncryptionConstant = Util.Rand32(); pk.Species = Species; diff --git a/PKHeX.Core/PKM/Util/PKMConverter.cs b/PKHeX.Core/PKM/Util/PKMConverter.cs index e5d3694b9..e4d6ecaa5 100644 --- a/PKHeX.Core/PKM/Util/PKMConverter.cs +++ b/PKHeX.Core/PKM/Util/PKMConverter.cs @@ -12,7 +12,7 @@ namespace PKHeX.Core /// public static class PKMConverter { - public static ITrainerInfo Trainer { private get; set; } = new SimpleTrainerInfo(); + public static ITrainerInfo Trainer { get; set; } = new SimpleTrainerInfo(); public static int Country => Trainer.Country; public static int Region => Trainer.SubRegion; public static int ConsoleRegion => Trainer.ConsoleRegion; diff --git a/Tests/PKHeX.Core.Tests/PKHeX.Core.Tests.csproj b/Tests/PKHeX.Core.Tests/PKHeX.Core.Tests.csproj index ce0662bc5..9aeb17c12 100644 --- a/Tests/PKHeX.Core.Tests/PKHeX.Core.Tests.csproj +++ b/Tests/PKHeX.Core.Tests/PKHeX.Core.Tests.csproj @@ -6,6 +6,16 @@ false + + + + + + + Always + + + @@ -18,18 +28,7 @@ - - True - True - Resources.resx - - - - - - ResXFileCodeGenerator - Resources.Designer.cs - + diff --git a/Tests/PKHeX.Core.Tests/Properties/Resources.Designer.cs b/Tests/PKHeX.Core.Tests/Properties/Resources.Designer.cs deleted file mode 100644 index 73ba5c21a..000000000 --- a/Tests/PKHeX.Core.Tests/Properties/Resources.Designer.cs +++ /dev/null @@ -1,73 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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.Core.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.Core.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.Core.Tests/Properties/Resources.resx b/Tests/PKHeX.Core.Tests/Properties/Resources.resx deleted file mode 100644 index ab6c59e50..000000000 --- a/Tests/PKHeX.Core.Tests/Properties/Resources.resx +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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.Core.Tests/Saves/SMTests.cs b/Tests/PKHeX.Core.Tests/Saves/SMTests.cs index bc798934f..4cee8e04a 100644 --- a/Tests/PKHeX.Core.Tests/Saves/SMTests.cs +++ b/Tests/PKHeX.Core.Tests/Saves/SMTests.cs @@ -1,5 +1,6 @@ using FluentAssertions; using PKHeX.Core; +using System.IO; using Xunit; namespace PKHeX.Tests.Saves @@ -8,7 +9,7 @@ public class SMTests { private SAV7 GetSave() { - return new SAV7(Core.Tests.Properties.Resources.SM_Project_802); + return new SAV7(File.ReadAllBytes("TestData/SM Project 802.main")); } [Fact] diff --git a/Tests/PKHeX.Core.Tests/Resources/SM Project 802.main b/Tests/PKHeX.Core.Tests/TestData/SM Project 802.main similarity index 100% rename from Tests/PKHeX.Core.Tests/Resources/SM Project 802.main rename to Tests/PKHeX.Core.Tests/TestData/SM Project 802.main