2 * Copyright (c) 2017. Developed by Hedgecode.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.hedgecode.snooker.json;
19 import org.junit.Test;
20 import org.junit.runner.RunWith;
21 import org.junit.runners.JUnit4;
24 * Tests for {@link JsonMatch}.
26 * @author Dmitry Samoshin aka gotty
28 @RunWith(JUnit4.class)
29 public class JsonMatchTest extends AbstractJsonTest {
32 public void testMatch() throws Exception {
33 JsonMatch[] jsonMatches = GSON.fromJson(
34 JsonStringToken.token(
39 //serialize(jsonMatches[0]);
40 JsonMatch expectedMatch = (JsonMatch) deserialize();
45 JsonMatch actualMatch = jsonMatches[0];
52 public static void assertEquals(JsonMatch expected, JsonMatch actual) {
53 assertEquals(expected.matchId(), actual.matchId());
54 assertEquals(expected.eventId(), actual.eventId());
55 assertEquals(expected.round(), actual.round());
56 assertEquals(expected.number(), actual.number());
57 assertEquals(expected.player1Id(), actual.player1Id());
58 assertEquals(expected.score1(), actual.score1());
59 assertEquals(expected.walkover1(), actual.walkover1());
60 assertEquals(expected.player2Id(), actual.player2Id());
61 assertEquals(expected.score2(), actual.score2());
62 assertEquals(expected.walkover2(), actual.walkover2());
63 assertEquals(expected.winnerId(), actual.winnerId());
64 assertEquals(expected.unfinished(), actual.unfinished());
65 assertEquals(expected.onBreak(), actual.onBreak());
66 assertEquals(expected.worldSnookerId(), actual.worldSnookerId());
67 assertEquals(expected.liveUrl(), actual.liveUrl());
68 assertEquals(expected.detailsUrl(), actual.detailsUrl());
69 assertEquals(expected.pointsDropped(), actual.pointsDropped());
70 assertEquals(expected.showCommonNote(), actual.showCommonNote());
71 assertEquals(expected.estimated(), actual.estimated());
72 assertEquals(expected.type(), actual.type());
73 assertEquals(expected.tableNo(), actual.tableNo());
74 assertEquals(expected.videoUrl(), actual.videoUrl());
75 assertEquals(expected.initDate(), actual.initDate());
76 assertEquals(expected.modDate(), actual.modDate());
77 assertEquals(expected.startDate(), actual.startDate());
78 assertEquals(expected.endDate(), actual.endDate());
79 assertEquals(expected.scheduledDate(), actual.scheduledDate());
80 assertEquals(expected.frameScores(), actual.frameScores());
81 assertEquals(expected.sessions(), actual.sessions());
82 assertEquals(expected.note(), actual.note());
83 assertEquals(expected.extendedNote(), actual.extendedNote());