summaryrefslogtreecommitdiff
path: root/server/tests/calculate_score.cpp
blob: cb4e0f21bafe1d8e4b273b1c5dd2d3776d071d80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#define BOOST_TEST_MODULE
#include <boost/test/unit_test.hpp>

#include <boost/assign/list_of.hpp>
using boost::assign::list_of;

#include "../player.h"

BOOST_AUTO_TEST_CASE(tsumo_tanyao) {
	Player player;
	player.client = make_shared<ClientDumb>();
	player.round_start(0);
	
	player.hand = list_of
		(Tile::Man_2)(Tile::Man_2)(Tile::Man_2)
		(Tile::Pin_2)(Tile::Pin_3)(Tile::Pin_4)
		(Tile::Sou_2)(Tile::Sou_2)(Tile::Sou_2)
		(Tile::Man_8)(Tile::Man_8);
	
	player.declare_tsumo();
	
	BOOST_CHECK_EQUAL(player.won, true);
	BOOST_CHECK_EQUAL(player.won_value.yaku, 2);
	BOOST_CHECK_EQUAL(player.won_value.fu, 28);
	BOOST_CHECK_EQUAL(player.won_value.tsumo(), 500);
	BOOST_CHECK_EQUAL(player.won_value.tsumo_east(), 1000);
}