@@ -43,7 +43,9 @@ mod tests {
4343 fn test_fallback_card ( ) {
4444 let mut state = create_test_game_state ( ) ;
4545 let fallback_card = Card :: FallBack ;
46- assert ! ( fallback_card. perform( & mut state) . is_ok( ) ) ;
46+ assert ! ( fallback_card
47+ . perform( & mut state, vec![ Card :: EatSalad , Card :: SwapCarrots ] )
48+ . is_ok( ) ) ;
4749 let current_player = state. clone_current_player ( ) ;
4850 assert_eq ! ( current_player. position, 2 ) ;
4951 }
@@ -52,8 +54,8 @@ mod tests {
5254 fn test_hurryahead_card ( ) {
5355 let mut state = create_test_game_state ( ) ;
5456 state. turn = 1 ;
55- let hurry_ahead_card = Card :: HurryAhead ;
56- assert ! ( hurry_ahead_card. perform( & mut state) . is_ok( ) ) ;
57+ let hurry_ahead_card: Card = Card :: HurryAhead ;
58+ assert ! ( hurry_ahead_card. perform( & mut state, vec! [ ] ) . is_ok( ) ) ;
5759 let current_player = state. clone_current_player ( ) ;
5860 assert_eq ! ( current_player. position, 7 ) ;
5961 }
@@ -62,7 +64,9 @@ mod tests {
6264 fn test_eatsalad_card ( ) {
6365 let mut state = create_test_game_state ( ) ;
6466 let eat_salad_card = Card :: EatSalad ;
65- assert ! ( eat_salad_card. perform( & mut state) . is_ok( ) ) ;
67+ assert ! ( eat_salad_card
68+ . perform( & mut state, vec![ Card :: FallBack , Card :: SwapCarrots ] )
69+ . is_ok( ) ) ;
6670 let current_player = state. clone_current_player ( ) ;
6771 assert_eq ! ( current_player. salads, 2 ) ;
6872 }
@@ -71,7 +75,9 @@ mod tests {
7175 fn test_swapcarrots_card ( ) {
7276 let mut state = create_test_game_state ( ) ;
7377 let swap_carrots_card = Card :: SwapCarrots ;
74- assert ! ( swap_carrots_card. perform( & mut state) . is_ok( ) ) ;
78+ assert ! ( swap_carrots_card
79+ . perform( & mut state, vec![ Card :: FallBack , Card :: EatSalad ] )
80+ . is_ok( ) ) ;
7581 let current_player = state. clone_current_player ( ) ;
7682 let other_player = state. clone_other_player ( ) ;
7783 assert_eq ! ( current_player. carrots, 60 ) ;
@@ -83,7 +89,7 @@ mod tests {
8389 let mut state = create_test_game_state ( ) ;
8490 state. turn = 1 ;
8591 let card_not_owned = Card :: FallBack ;
86- let result = card_not_owned. perform ( & mut state) ;
92+ let result = card_not_owned. perform ( & mut state, vec ! [ Card :: HurryAhead ] ) ;
8793 assert ! ( result. is_err( ) ) ;
8894 }
8995
@@ -94,7 +100,7 @@ mod tests {
94100 let mut current_player = state. clone_current_player ( ) ;
95101 current_player. position = 1 ;
96102 state. update_player ( current_player) ;
97- let result = card. perform ( & mut state) ;
103+ let result = card. perform ( & mut state, vec ! [ Card :: EatSalad , Card :: SwapCarrots ] ) ;
98104 assert ! ( result. is_err( ) ) ;
99105 }
100106
@@ -103,7 +109,7 @@ mod tests {
103109 let mut state = create_test_game_state ( ) ;
104110 let invalid_card = Card :: FallBack ;
105111 state. board . track . clear ( ) ;
106- let result = invalid_card. perform ( & mut state) ;
112+ let result = invalid_card. perform ( & mut state, vec ! [ Card :: EatSalad , Card :: SwapCarrots ] ) ;
107113 assert ! ( result. is_err( ) ) ;
108114 }
109115}
0 commit comments