Пример #1
0
        public void SequenceMinAndMaxTheSame()
        {
            var result = SequenceGenerator.GenerateAsync(10, 10).Result.ToList();

            Assert.AreEqual(1, result.Count());
            Assert.AreEqual(10, result.First());
        }
Пример #2
0
        public void SequenceMinLargerThandMax()
        {
            ExecuteInTryCatch(() => SequenceGenerator.GenerateAsync(100, 1).Wait());

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

            Assert.AreEqual(1, _exceptionsThrown.Count);
            Assert.True(_exceptionsThrown.First().ContainsInnerExceptionOfType(typeof(ArgumentException)));
        }
Пример #4
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());
            }
        }