示例#1
0
        public void Lotofacil_IsCorrect()
        {
            Assert.AreEqual(15, SimpleFunctions.Lotofacil().Count);
            Assert.AreEqual(16, SimpleFunctions.Lotofacil(16).Count);

            var sortedNumbers = SimpleFunctions.Lotofacil();
            var hashSet       = new HashSet <int>(sortedNumbers);

            Assert.AreEqual(sortedNumbers.Count, hashSet.Count);
        }
示例#2
0
        public void Lotofacil_WithNumbersParameter_OutOfRange()
        {
            // Using an anonymous delegate
            Assert.Throws <ArgumentOutOfRangeException>(
                delegate
            {
                SimpleFunctions.Lotofacil(19);
            });

            // Using a Lambda expression
            Assert.Throws <ArgumentOutOfRangeException>(
                () =>
            {
                SimpleFunctions.Lotofacil(14);
            });
        }