use of com.nolanlawson.keepscore.serialization.GamesBackup in project KeepScore by nolanlawson.
the class SerializationTest method testGamesBackup.
private void testGamesBackup(GamesBackup gamesBackup) {
String xmlData = GamesBackupSerializer.serialize(gamesBackup);
GamesBackup deserializedGamesBackup = GamesBackupSerializer.deserialize(xmlData);
compareGamesBackups(gamesBackup, deserializedGamesBackup);
}
use of com.nolanlawson.keepscore.serialization.GamesBackup in project KeepScore by nolanlawson.
the class SerializationTest method testSingleGame.
public void testSingleGame() {
GamesBackup gamesBackup = createRandomGamesBackup();
gamesBackup.setGames(Collections.singletonList(gamesBackup.getGames().get(0)));
testGamesBackup(gamesBackup);
}
use of com.nolanlawson.keepscore.serialization.GamesBackup in project KeepScore by nolanlawson.
the class SerializationTest method testNullsAndEmpties.
public void testNullsAndEmpties() {
GamesBackup gamesBackup = createRandomGamesBackup();
gamesBackup.getGames().get(0).setName(null);
gamesBackup.getGames().get(1).setName("");
gamesBackup.getGames().get(0).getPlayerScores().get(0).setName(null);
gamesBackup.getGames().get(0).getPlayerScores().get(0).setPlayerColor(PlayerColor.BUILT_INS[7]);
gamesBackup.getGames().get(0).getPlayerScores().get(1).setName("");
gamesBackup.getGames().get(0).getPlayerScores().get(1).setPlayerColor(new CustomPlayerColor(Color.parseColor("#FF00FF00")));
gamesBackup.getGames().get(0).getPlayerScores().get(0).setHistory(Collections.<Delta>emptyList());
testGamesBackup(gamesBackup);
}
use of com.nolanlawson.keepscore.serialization.GamesBackup in project KeepScore by nolanlawson.
the class SerializationTest method testBasicSerialization.
public void testBasicSerialization() {
GamesBackup gamesBackup = createRandomGamesBackup();
testGamesBackup(gamesBackup);
}
Aggregations