@@ -229,77 +229,78 @@ TEST(PlayerTest, Buy_DevCard_False){
229229 ASSERT_TRUE (validateResourceAmount (1 ,1 ,0 ,1 ,1 ,tp));
230230}
231231
232- // VICTORY POINT TESTS HERE
233- TEST (PlayerTest, PlayerTest, UpdateVictoryPoints_Settlements){
232+
233+ // INSERT VICTORY POINT TESTS HERE
234+ TEST (PlayerTest, UpdateVictoryPoints_Settlements){
234235 GameBoard test_board ({" tester" });
235236 Player& test_player = test_board.getPlayer (0 );
236237
237- ASSERT_TRUE (test_player.getVictoryPoints () == 0 );
238+ ASSERT_EQ (test_player.getVictoryPoints (), 0 );
238239
239240 Coordinate start1 (0 ,0 );
240241 test_board.PlaceSettlement (start1, test_player);
241242
242- ASSERT_TRUE (test_player.getVictoryPoints () == 1 );
243+ ASSERT_EQ (test_player.getVictoryPoints (), 1 );
243244}
244245
245246TEST (PlayerTest, UpdateVictoryPoints_cities){
246247 GameBoard test_board ({" tester" });
247248 Player& test_player = test_board.getPlayer (0 );
248249
249- ASSERT_TRUE (test_player.getVictoryPoints () == 0 );
250+ ASSERT_EQ (test_player.getVictoryPoints (), 0 );
250251
251252 Coordinate start1 (0 ,0 );
252253 test_board.PlaceSettlement (start1, test_player);
253254
254- ASSERT_TRUE (test_player.getVictoryPoints () == 1 );
255+ ASSERT_EQ (test_player.getVictoryPoints (), 1 );
255256
256257 test_board.UpgradeSettlement (start1);
257- ASSERT_TRUE (test_player.getVictoryPoints () == 2 );
258+ ASSERT_EQ (test_player.getVictoryPoints (), 2 );
258259}
259260
260261TEST (PlayerTest, UpdateVictoryPoints_longestRoad){
261262 GameBoard test_board ({" tester" });
262263 Player& test_player = test_board.getPlayer (0 );
263264
264- ASSERT_TRUE (test_player.getVictoryPoints () == 0 );
265+ ASSERT_EQ (test_player.getVictoryPoints (), 0 );
265266
266267 Coordinate start1 (0 ,0 );
267268 test_board.PlaceSettlement (start1, test_player);
268269
269- ASSERT_TRUE (test_player.getVictoryPoints () == 1 );
270+ ASSERT_EQ (test_player.getVictoryPoints (), 1 );
270271
271272 test_board.PlaceRoad (start1, Coordinate (-1 ,1 ), test_player);
272273 test_board.PlaceRoad (Coordinate (-1 ,1 ), Coordinate (-1 ,2 ), test_player);
273274 test_board.PlaceRoad (Coordinate (-1 ,2 ), Coordinate (0 ,2 ), test_player);
274275 test_board.PlaceRoad (Coordinate (0 ,2 ), Coordinate (0 ,3 ), test_player);
275276 test_board.PlaceRoad (Coordinate (0 ,3 ), Coordinate (1 ,3 ), test_player);
276277
277- ASSERT_TRUE (test_player.getVictoryPoints () == 3 );
278+ ASSERT_EQ (test_player.getVictoryPoints (), 3 );
278279}
279280
280281TEST (PlayerTest, UpdateVictoryPoints_VictoryCards){
281282 GameBoard test_board ({" tester" });
282283 Player& test_player = test_board.getPlayer (0 );
283284
284- ASSERT_TRUE (test_player.getVictoryPoints () == 0 );
285- ASSERT_TRUE (test_player.getVictoryPointsWithoutCards () == 0 );
285+ ASSERT_EQ (test_player.getVictoryPoints (), 0 );
286+ ASSERT_EQ (test_player.getVictoryPointsWithoutCards (), 0 );
286287
287288 std::unique_ptr<DevelopmentCard> test_VictoryCard = std::unique_ptr<DevelopmentCard>(new VictoryPointCard ());
288289 test_player.addOre (1 );
289290 test_player.addWheat (1 );
290291 test_player.addWool (1 );
291292
292293 test_player.buyCard (test_VictoryCard);
293- ASSERT_TRUE (test_player.getVictoryPoints () == 1 );
294- ASSERT_TRUE (test_player.getVictoryPointsWithoutCards () == 0 );
294+ ASSERT_EQ (test_player.getVictoryPoints (), 1 );
295+ ASSERT_EQ (test_player.getVictoryPointsWithoutCards (), 0 );
295296}
296297
297298TEST (PlayerTest, UpdateVictoryPoints_LargestArmy){
298299 GameBoard test_board ({" tester1" , " tester2" });
299300 Player& test_player = test_board.getPlayer (0 );
300301 Player& opponent = test_board.getPlayer (1 );
301302
302- ASSERT_TRUE (test_player.getVictoryPoints () == 0 );
303+ ASSERT_EQ (test_player.getVictoryPoints (), 0 );
303304
304305 test_player.addOre (3 );
305306 test_player.addWheat (3 );
@@ -311,59 +312,59 @@ TEST(PlayerTest, UpdateVictoryPoints_LargestArmy){
311312 test_player.buyCard (test_KnightCard);
312313
313314 test_board.PlaceSettlement (Coordinate (0 ,0 ), opponent);
314- // WILL NOT WORK UNTIL THE KNIGHT WORKS
315- // test_player.playKnight(Coordinate(0,1), opponent);
316- // test_player.playKnight(Coordinate(0,1), opponent);
317- // test_player.playKnight(Coordinate(0,1), opponent);
318- //
319- // ASSERT_TRUE (test_player.getVictoryPoints() == 2);
315+
316+ test_player.playKnight (Coordinate (0 ,1 ), opponent);
317+ test_player.playKnight (Coordinate (0 ,1 ), opponent);
318+ test_player.playKnight (Coordinate (0 ,1 ), opponent);
319+
320+ ASSERT_EQ (test_player.getVictoryPoints (), 2 );
320321}
321322
322323TEST (PlayerTest, UpdateVictoryPoints_all){
323324 GameBoard test_board ({" tester" , " opponent" });
324325 Player& test_player = test_board.getPlayer (0 );
325326 Player& opponent = test_board.getPlayer (1 );
326327
327- ASSERT_TRUE (test_player.getVictoryPoints () == 0 );
328+ ASSERT_EQ (test_player.getVictoryPoints (), 0 );
328329
329330 Coordinate start1 (0 ,0 );
330331
331332 test_board.PlaceSettlement (start1, test_player);
332333
333- ASSERT_TRUE (test_player.getVictoryPoints () == 1 );
334+ ASSERT_EQ (test_player.getVictoryPoints (), 1 );
334335
335336 test_board.PlaceRoad (start1, Coordinate (-1 ,1 ), test_player);
336337 test_board.PlaceRoad (Coordinate (-1 ,1 ), Coordinate (-1 ,2 ), test_player);
337338 test_board.PlaceRoad (Coordinate (-1 ,2 ), Coordinate (0 ,2 ), test_player);
338339 test_board.PlaceRoad (Coordinate (0 ,2 ), Coordinate (0 ,3 ), test_player);
339340 test_board.PlaceRoad (Coordinate (0 ,3 ), Coordinate (1 ,3 ), test_player);
340341
341- ASSERT_TRUE (test_player.getVictoryPoints () == 3 );
342+ ASSERT_EQ (test_player.getVictoryPoints (), 3 );
342343
343344 test_board.UpgradeSettlement (start1);
344345
345- ASSERT_TRUE (test_player.getVictoryPoints () == 4 );
346+ ASSERT_EQ (test_player.getVictoryPoints (), 4 );
346347
347348 std::unique_ptr<DevelopmentCard> test_VictoryCard = std::unique_ptr<DevelopmentCard>(new VictoryPointCard ());
348349 test_player.addOre (4 );
349350 test_player.addWheat (4 );
350351 test_player.addWool (4 );
351352
352353 test_player.buyCard (test_VictoryCard);
353- ASSERT_TRUE (test_player.getVictoryPoints () == 5 );
354+ ASSERT_EQ (test_player.getVictoryPoints (), 5 );
354355
355356 std::unique_ptr<DevelopmentCard> test_KnightCard = std::unique_ptr<DevelopmentCard>(new KnightCard ());
356357 test_player.buyCard (test_KnightCard);
357358 test_player.buyCard (test_KnightCard);
358359 test_player.buyCard (test_KnightCard);
359360
360- // WILL NOT WORK UNTIL THE KNIGHT WORKS
361- // test_board.PlaceSettlement(Coordinate(0,6), opponent);
362- //
363- // test_player.playKnight(Coordinate(0,5), opponent);
364- // test_player.playKnight(Coordinate(0,5), opponent);
365- // test_player.playKnight(Coordinate(0,5), opponent);
366- //
367- // ASSERT_TRUE(test_player.getVictoryPoints() == 7);
361+ test_board.PlaceSettlement (Coordinate (0 ,5 ), opponent);
362+
363+ test_player.playKnight (Coordinate (0 ,4 ), opponent);
364+ test_player.playKnight (Coordinate (0 ,4 ), opponent);
365+ test_player.playKnight (Coordinate (0 ,4 ), opponent);
366+
367+ ASSERT_EQ (test_player.getVictoryPoints (), 7 );
368368}
369369
370+
0 commit comments