public void PokemonSaver_SavePokedex_HappyPass(string fileName) { Pokedex expect = new Pokedex(); Pokedex actrul; Pokemon thePokemon = new Pokemon { Index = 1, Name = "Bulbasaur", Type1 = "Grass", Type2 = "Poison", HP = 128, Attack = 118, Defense = 111, MaxCP = 1115 }; expect.Pokemons.Add(thePokemon); //set up unique fileName path += fileName; saver.Save_Pokedex(expect, path); // Load up the actrul actrul = reader.Load_Pokedex(path); Assert.AreEqual(expect, actrul); }
public void PokemonReader_Load_Pokedex_HappyPath() { Pokedex expect = new Pokedex(); Pokedex actrual; // set up expect Pokemon thePokemon = new Pokemon { Index = 1, Name = "Bulbasaur", Type1 = "Grass", Type2 = "Poison", HP = 128, Attack = 118, Defense = 111, MaxCP = 1115 }; expect.Pokemons.Add(thePokemon); // Create a simple test xml for Pokedex string fileName = "testUse_pokedex.xml"; path += fileName; using (FileStream fs = new FileStream(path, FileMode.Create)) { using (StreamWriter sw = new StreamWriter(fs)) { sw.WriteLine(pokedex_sourceExample_XML); } } actrual = testReader.Load_Pokedex(path); Assert.AreEqual(expect, actrual); }