Add showdownset parse case template test

This commit is contained in:
Kurt
2018-05-11 21:44:09 -07:00
parent bb5622f5db
commit 9c5814346b
2 changed files with 21 additions and 4 deletions

View File

@@ -188,7 +188,8 @@ private string GetText()
// Secondary Stats
if (Ability > -1 && Ability < abilities.Length)
result.Add($"Ability: {abilities[Ability]}");
result.Add($"Level: {Level}");
if (Level != 100)
result.Add($"Level: {Level}");
if (Shiny)
result.Add("Shiny: Yes");

View File

@@ -14,9 +14,12 @@ public class ShowdownSetTests
[TestCategory(SimulatorParse)]
public void SimulatorGetParse()
{
var set = new ShowdownSet(SetGlaceonUSUMTutor);
string Sanitize(string str) => str.Replace("\r\n", "").Replace("\n", "");
Assert.IsTrue(Sanitize(SetGlaceonUSUMTutor) == Sanitize(set.Text));
foreach (var setstr in Sets)
{
var set = new ShowdownSet(setstr).Text;
var lines = set.Split('\n').Select(z => z.Trim());
Assert.IsTrue(lines.All(z => setstr.Contains(z)), setstr);
}
}
[TestMethod]
@@ -84,5 +87,18 @@ Modest Nature
- Shadow Ball
- Hyper Voice";
private static readonly string[] Sets =
{
SetGlaceonUSUMTutor,
@"Greninja @ Choice Specs
Ability: Battle Bond
EVs: 252 SpA / 4 SpD / 252 Spe
Timid Nature
- Hydro Pump
- Spikes
- Water Shuriken
- Dark Pulse",
};
}
}