예제 #1
0
        public void MultipleDrawnNumbers()
        {
            var lotteryNumbers = new List <int>();
            var lottery        = new DemoLottery();

            var expectedEmpty = new List <int> ();
            var actual        = lottery.GetLotteryNumbers();

            CollectionAssert.AreEqual(expectedEmpty, actual);

            var expected5 = new List <int>()
            {
                5
            };

            actual = lottery.GetLotteryNumbers(5);
            CollectionAssert.AreEqual(expected5, actual);

            var expected15 = new List <int>()
            {
                1, 5
            };

            actual = lottery.GetLotteryNumbers(1);
            CollectionAssert.AreEqual(expected15, actual);

            var expected1533 = new List <int>()
            {
                1, 5, 33
            };

            actual = lottery.GetLotteryNumbers(33);
            CollectionAssert.AreEqual(expected1533, actual);
        }
예제 #2
0
        public void ReturnAnEmptyList()
        {
            var lotteryNumbers = new List <int>();

            var lottery = new DemoLottery();

            Assert.IsTrue(lottery.GetLotteryNumbers().Count == 0);
        }
예제 #3
0
        public void ReturnASortedList()
        {
            var lottery  = new DemoLottery();
            var expected = new List <int> {
                1, 2, 3
            };
            var actual = lottery.GetLotteryNumbers(2);

            actual = lottery.GetLotteryNumbers(1);
            actual = lottery.GetLotteryNumbers(3);
            CollectionAssert.AreEqual(expected, actual);
        }
예제 #4
0
        public void ReturnAListOfNumbers()
        {
            var lotteryNumbers = new List <int>()
            {
                1, 5, 7, 8
            };

            var lottery = new DemoLottery();

            var expected = new List <int> {
                1, 5, 7, 8
            };
            var actual = lottery.GetLotteryNumbers(1);

            actual = lottery.GetLotteryNumbers(5);
            actual = lottery.GetLotteryNumbers(7);
            actual = lottery.GetLotteryNumbers(8);
            Assert.IsTrue((expected.Count == actual.Count) && !expected.Except(actual).Any());
        }
예제 #5
0
 static void Main(string[] args)
 {
     var badLottery = new DemoLottery();
 }