public void TestFullHouse_MultiUseCategory_ThrowsException()
 {
     DieSet dieSet = new DieSet(1, 1, 2, 3, 1);
     ScoringCategory fullHouse = new FullHouseCategory();
     int score = fullHouse.Score(dieSet.getCount());
     score = fullHouse.Score(dieSet.getCount());
 }
 public void TestFullHouseNoScore()
 {
     DieSet die = new DieSet(1, 2, 3, 4, 5);
     ScoringCategory fullHouse = new FullHouseCategory();
     int score = fullHouse.CalculateScoreForRoll(die.getCount());
     Assert.IsTrue(score == 0);
 }
示例#3
0
        public void CanPassNullAndThrowsException()
        {
            //arrange
            ICategory fullHouse = new FullHouseCategory();

            //act
            //assert
            Assert.Throws <ArgumentNullException>(() => fullHouse.CalculateScore(null));
        }
 public void TestScoreFullHouse()
 {
     DieSet die = new DieSet(6, 6, 6, 5, 5);
     ScoringCategory fullHouse = new FullHouseCategory();
     Assert.IsTrue(fullHouse.Name == "Full House");
     Assert.IsTrue(fullHouse.HasBeenUsed == false);
     Assert.IsTrue(fullHouse.Lower);
     Assert.IsFalse(fullHouse.Upper);
     fullHouse.Score(die.getCount());
     Assert.IsTrue(fullHouse.HasBeenUsed == true);
     Assert.IsTrue(fullHouse.FinalScore == 25);
 }
示例#5
0
        public void ReturnsSumWhereThereIsAFullHouse()
        {
            //arrange
            ICategory  fullHouse   = new FullHouseCategory();
            List <int> diceNumbers = new List <int>()
            {
                2, 2, 2, 1, 1
            };

            //act
            //assert
            Assert.AreEqual(8, fullHouse.CalculateScore(diceNumbers));
        }
 public void TestFullHouseRules()
 {
     ScoringCategory fullHouse = new FullHouseCategory();
     Assert.AreEqual("Full House: If there are three of one value and two of a different value, score 25.  Otherwise, score 0.", fullHouse.getRules());
 }