Пример #1
0
        public void IntegerMinValueTooSmallTest()
        {
            ExecuteInTryCatch(() => IntegerGenerator.GenerateAsync(10, (int)-Math.Pow(10, 8) - 1, 10000).Wait());

            Assert.AreEqual(1, _exceptionsThrown.Count);
            Assert.True(_exceptionsThrown.First().ContainsInnerExceptionOfType(typeof(ArgumentException)));
        }
Пример #2
0
        public void IntegerMinLargerThandMax()
        {
            ExecuteInTryCatch(() => IntegerGenerator.GenerateAsync(10, 100, 1).Wait());

            Assert.AreEqual(1, _exceptionsThrown.Count);
            Assert.True(_exceptionsThrown.First().ContainsInnerExceptionOfType(typeof(ArgumentException)));
        }
Пример #3
0
        public void IntegerNumberRequestedTooLargeTest()
        {
            ExecuteInTryCatch(() => IntegerGenerator.GenerateAsync((int)Math.Pow(10, 3) + 1, 1, 10).Wait());

            Assert.AreEqual(1, _exceptionsThrown.Count);
            Assert.True(_exceptionsThrown.First().ContainsInnerExceptionOfType(typeof(ArgumentException)));
        }
Пример #4
0
        public void IntegerMinAndMaxTheSame()
        {
            var result = IntegerGenerator.GenerateAsync(10, 10, 10).Result.ToList();

            Assert.AreEqual(1, result.Count());
            Assert.AreEqual(10, result.First());
        }
Пример #5
0
        public static void Main(string[] args)
        {
            var result = IntegerGenerator.GenerateAsync(10, 1, 6).Result;

            foreach (var item in result)
            {
                Console.WriteLine(item.ToString());
            }

            Console.WriteLine("---");


            result = SequenceGenerator.GenerateAsync(1, 6).Result;
            foreach (var item in result)
            {
                Console.WriteLine(item.ToString());
            }
        }