コード例 #1
0
        public void AddRandomNumber()
        {
            var lotteryNumbers = new List <int>();
            var lottery        = new Lottery();

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

            CollectionAssert.AreEqual(expectedEmpty, actual);

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

            actual = lottery.GetLotteryNumbers();

            CollectionAssert.AreEqual(expected5, actual);

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

            actual = lottery.GetLotteryNumbers();

            CollectionAssert.AreEqual(expected15, actual);

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

            actual = lottery.GetLotteryNumbers();

            CollectionAssert.AreEqual(expected1533, actual);
        }