public void RunOutputValidTest() { _manager.Generate(); SaveFileModel model1 = null, model2 = null; try { model1 = _deserializer.Deserialize(Path.Combine(_outputDir, _opts.Options.PlayerOne.OutputSaveLocation)); model2 = _deserializer.Deserialize(Path.Combine(_outputDir, _opts.Options.PlayerTwo.OutputSaveLocation)); } catch (Exception e) { Assert.True(false, $"Failed to parse the output save files: {e}"); } Assert.NotNull(model1); Assert.NotNull(model2); // Basic checks Assert.Equal("Test1", model1.PlayerName); Assert.Equal("Test2", model2.PlayerName); Assert.Equal(_opts.Configuration.TeamSize, model1.TeamPokemonList.Pokemon.Count()); Assert.Equal(_opts.Configuration.TeamSize, model2.TeamPokemonList.Pokemon.Count()); foreach (var pokemon in model1.TeamPokemonList.Pokemon) { Assert.Equal(100, pokemon.Level); } }
public void SerializeSaveFileModalHasCorrectLengthTest() { // Generate var resultModel = _saveFileRepository.Deserialize(_testStreamShim); // Assert Assert.NotNull(resultModel); Assert.Equal(6, resultModel.TeamPokemonList.Count); }
/// <inheritdoc /> public SaveFileModel Load(string filename) { return(_saveFileRepository.Deserialize(filename)); }