private static void VerifyContents(this TeamPasteInfo tpi, string name, int[] speciesPresent) { tpi.Valid.Should().BeTrue("Data should exist for this paste"); tpi.Title.Should().Be(name, "Data should have a title present"); var team = ShowdownUtil.ShowdownSets(tpi.Sets); var species = team.ConvertAll(s => s.Species); var hasAll = speciesPresent.All(species.Contains); hasAll.Should().BeTrue("Specific species are expected"); }
/// <summary> /// Imports <see cref="ShowdownSet"/> list(s) originating from a concatenated list. /// </summary> /// <param name="source">Text containing <see cref="ShowdownSet"/> data</param> public static void Import(string source) { if (ShowdownUtil.IsTeamBackup(source)) { var teams = ShowdownTeamSet.GetTeams(source).ToArray(); var names = teams.Select(z => z.Summary); WinFormsUtil.Alert("Generating the following teams:", string.Join(Environment.NewLine, names)); Import(teams.SelectMany(z => z.Team).ToList()); return; } var sets = ShowdownUtil.ShowdownSets(source); Import(sets); }