コード例 #1
0
        public void Played_cards_memory_should_work()
        {
            var briscola = new Card("Spade", 3);
            var state    = GameStateBuilder.GetBuilder().Build(_sut, briscola);

            state.Dish.Add(new Card("Danari", 4));
            state.Dish.Add(new Card("Bastoni", 1));

            var me = state.Players.Single(x => x.Strategy == _sut);

            _sut.Watch(me, state);

            _sut.GetPlayedCards().Count().Should().Be.EqualTo(2);
            _sut.GetPlayedCards().ElementAt(0).Should().Be.EqualTo(new Card("Danari", 4));
            _sut.GetPlayedCards().ElementAt(1).Should().Be.EqualTo(new Card("Bastoni", 1));
        }
コード例 #2
0
        public void Se_sono_quarto_e_compagno_prende_carico()
        {
            var state = GameStateBuilder.GetBuilder().Build(_sut, new Card("Spade", 4), 4);

            state.Dish.Add(new Card("Bastoni", 3));
            state.Dish.Add(new Card("Spade", 5));
            state.Dish.Add(new Card("Danari", 7));

            var me = state.Players.First(x => x.Strategy == _sut);

            me.Take(new Card("Spade", 6));
            me.Take(new Card("Danari", 1));
            me.Take(new Card("Bastoni", 8));

            Card card = _sut.Choose(me, state);

            card.Should().Be.EqualTo(new Card("Danari", 1));
        }
コード例 #3
0
        public void Se_piu_di_11_punti_prendo()
        {
            var state = GameStateBuilder.GetBuilder().Build(_sut, new Card("Spade", 4), 4);

            state.Dish.Add(new Card("Bastoni", 1));
            state.Dish.Add(new Card("Bastoni", 8));
            state.Dish.Add(new Card("Danari", 4));

            var me = state.Players.First(x => x.Strategy == _sut);

            me.Take(new Card("Danari", 5));
            me.Take(new Card("Spade", 5));
            me.Take(new Card("Danari", 7));

            Card card = _sut.Choose(me, state);

            card.Should().Be.EqualTo(new Card("Spade", 5));
        }