Skip to content
Snippets Groups Projects
Commit 365a1b35 authored by marlehmann's avatar marlehmann
Browse files

prelim player test

parent b8118bab
No related branches found
No related tags found
2 merge requests!17finalize common,!16Draft: Resolve "write_common_tests"
//
// Created by martinalavanya on 23.11.24.
//
#include "gtest/gtest.h"
#include "../src/common/exceptions/WizardException.h"
#include "../src/common/game_state/player/player.h"
#include "../src/common/serialization/json_utils.h"
TEST(PlayerTest, CreatePlayer)
{
std::string name = "vatkruidvat";
player test_player(name);
//check name
EXPECT_EQ(test_player.get_player_name(), name);
// check tricks
int nof_tricks = 2;
test_player.set_nof_tricks(nof_tricks);
EXPECT_FALSE(test_player.get_nof_tricks(), 3);//should fail
//check predicted tricks
int pred_tricks = 4;
test_player.set_nof_predicted(pred_tricks);
EXPECT_EQ(test_player.get_nof_predicted(), pred_tricks);
//check score
int score = 7;
test_player.set_scores(score);
EXPECT_EQ(test_player.get_scores(), score);
//check that removing card from empty hand does not work
//check wrap_up_round()
}
TEST(HandTest, RemoveFromEmptyHand)
{
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment