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))); }
public void IntegerMinLargerThandMax() { ExecuteInTryCatch(() => IntegerGenerator.GenerateAsync(10, 100, 1).Wait()); Assert.AreEqual(1, _exceptionsThrown.Count); Assert.True(_exceptionsThrown.First().ContainsInnerExceptionOfType(typeof(ArgumentException))); }
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))); }
public void IntegerMinAndMaxTheSame() { var result = IntegerGenerator.GenerateAsync(10, 10, 10).Result.ToList(); Assert.AreEqual(1, result.Count()); Assert.AreEqual(10, result.First()); }
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()); } }