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

            Assert.AreEqual(7, lotteryNumbers.Count, "New LotteryRow should have 7 numbers in the list!");
        }
Ejemplo n.º 2
0
        public void TestListShouldBeSorted()
        {
            LotteryRow row            = new LotteryRow();
            List <int> lotteryNumbers = row.Numbers();

            Assert.AreNotEqual(0, lotteryNumbers.Count, "The list should not be empty and the numbers should be sorted!");
            Assert.That(lotteryNumbers, Is.Ordered.Ascending, "Numbers should be sorted!");
        }
Ejemplo n.º 3
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!");
        }
Ejemplo n.º 4
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!");
        }