Esempio n. 1
0
        public void ContainsNumberShouldReturnFalse()
        {
            LotteryRow row            = new LotteryRow();
            List <int> lotteryNumbers = row.Numbers();

            Assert.AreNotEqual(0, lotteryNumbers.Count, "The list should not be empty and ContainsNumber should return False for numbers out of range!");
            Assert.AreEqual(false, row.ContainsNumber(0), "ContainsNumber should never find 0 from the list!");
            Assert.AreEqual(false, row.ContainsNumber(41), "ContainsNumber should never find 41 numbers from the list!");
        }
Esempio n. 2
0
        public void ContainsNumberShouldReturnTrue()
        {
            LotteryRow row            = new LotteryRow();
            List <int> lotteryNumbers = row.Numbers();

            Assert.AreNotEqual(0, lotteryNumbers.Count, "The list should not contain 7 numbers and ContainsNumber should return True for them!");
            Assert.AreEqual(true, row.ContainsNumber(lotteryNumbers[0]), "ContainsNumber should find the numbers from the list!");
            Assert.AreEqual(true, row.ContainsNumber(lotteryNumbers[1]), "ContainsNumber should find the numbers from the list!");
            Assert.AreEqual(true, row.ContainsNumber(lotteryNumbers[2]), "ContainsNumber should find the numbers from the list!");
            Assert.AreEqual(true, row.ContainsNumber(lotteryNumbers[3]), "ContainsNumber should find the numbers from the list!");
            Assert.AreEqual(true, row.ContainsNumber(lotteryNumbers[4]), "ContainsNumber should find the numbers from the list!");
            Assert.AreEqual(true, row.ContainsNumber(lotteryNumbers[5]), "ContainsNumber should find the numbers from the list!");
            Assert.AreEqual(true, row.ContainsNumber(lotteryNumbers[6]), "ContainsNumber should find the numbers from the list!");
        }