From b3b9713aa2c98ac0390cb77fc9912a0a8cf8bf2d Mon Sep 17 00:00:00 2001 From: Kurt Date: Tue, 3 Apr 2018 19:34:24 -0700 Subject: [PATCH] Switch assert comparison AreEqual checking by Reference? strip out newlines and compare with string equals instead add testing method for generating full dex of pkm (still WIP hence commented out attributes) --- .../PKHeX.Tests/Simulator/ShowdownSetTests.cs | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/Tests/PKHeX.Tests/Simulator/ShowdownSetTests.cs b/Tests/PKHeX.Tests/Simulator/ShowdownSetTests.cs index d0fbccd8b..59c15473a 100644 --- a/Tests/PKHeX.Tests/Simulator/ShowdownSetTests.cs +++ b/Tests/PKHeX.Tests/Simulator/ShowdownSetTests.cs @@ -1,4 +1,5 @@ -using System.Linq; +using System.Diagnostics; +using System.Linq; using Microsoft.VisualStudio.TestTools.UnitTesting; using PKHeX.Core; @@ -14,7 +15,8 @@ public class ShowdownSetTests public void SimulatorGetParse() { var set = new ShowdownSet(SetGlaceonUSUMTutor); - Assert.AreEqual(SetGlaceonUSUMTutor, set.Text); + string Sanitize(string str) => str.Replace("\r\n", "").Replace("\n", ""); + Assert.IsTrue(Sanitize(SetGlaceonUSUMTutor) == Sanitize(set.Text)); } [TestMethod] @@ -46,6 +48,22 @@ public void SimulatorGetEncounters() } } + //[TestMethod] + //[TestCategory(SimulatorParse)] + public void TestGenerate() + { + for (int i = 1; i <= 807; i++) + { + var tr = new SimpleTrainerInfo(); + var pk = new PK7 { Species = i }; + var ez = EncounterMovesetGenerator.GeneratePKMs(pk, tr); + Debug.WriteLine($"Starting {i:000}"); + bool v = ez.Select(p => new LegalityAnalysis(p)).All(la => la.Valid); + Debug.WriteLine($"Finished {i:000}"); + Debug.Assert(v); + } + } + private const string SetGlaceonUSUMTutor = @"Glaceon (F) @ Assault Vest IVs: 0 Atk