public void IsSatisfied_Calls_Validator()
        {
            // Arrange
            m_Validator.IsValid().Returns(true);

            // Act
            // Assert
            Assert.True(m_Sut.IsSatisfied());
        }
        public void Apply_Updates_Status()
        {
            // Arrange
            m_Validator.IsValid().Returns(true);

            // Act
            IPlayerHandInformation actual = m_Sut.Apply(m_Info);

            // Assert
            Assert.AreEqual(Status.FullHouse,
                            actual.Status);
        }
Beispiel #3
0
        public override IPlayerHandInformation Apply(IPlayerHandInformation info)
        {
            m_Validator.Cards = info.Cards;
            if (!m_Validator.IsValid())
            {
                return(info);
            }

            info.Status       = Status.FullHouse;
            info.TwoOfAKind   = m_Validator.TwoOfAKind;
            info.ThreeOfAKind = m_Validator.ThreeOfAKind;

            return(info);
        }
Beispiel #4
0
        public int?RecordFullHouse(IDiceCup diceCup)
        {
            if (FullHouse != null)
            {
                return(null);
            }

            if (_fullHouseValidator.IsValid(diceCup.Dice))
            {
                FullHouse = 25;
            }
            else
            {
                FullHouse = 0;
            }

            return(FullHouse);
        }