コード例 #1
0
ファイル: ParameterTests.cs プロジェクト: AIBrain/RandomNet
        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
ファイル: ParameterTests.cs プロジェクト: AIBrain/RandomNet
        public void IntegerMinLargerThandMax()
        {
            ExecuteInTryCatch(() => IntegerGenerator.GenerateAsync(10, 100, 1).Wait());

            Assert.AreEqual(1, _exceptionsThrown.Count);
            Assert.True(_exceptionsThrown.First().ContainsInnerExceptionOfType(typeof(ArgumentException)));
        }
コード例 #3
0
ファイル: ParameterTests.cs プロジェクト: AIBrain/RandomNet
        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
ファイル: ParameterTests.cs プロジェクト: AIBrain/RandomNet
        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());
            }
        }