public void RandomBetweenPrecisionCanBeNegativeTest() { bool canBeNegative = false; for (var i = 0; i < 10000; i++) { var actual = GeneFactory.RandomBetween(-1m, 1m, 0); if (actual == -1) { canBeNegative = true; break; } } Assert.IsTrue(canBeNegative); }
public void RandomBetweenPrecisionCanBeMaximumTest() { bool canBeMaximum = false; for (var i = 0; i < 10000; i++) { var actual = GeneFactory.RandomBetween(1.1m, 1.2m, 1); if (actual == 1.2m) { canBeMaximum = true; break; } } Assert.IsTrue(canBeMaximum); }
public void RandomBetweenPrecisionTest() { var actual = GeneFactory.RandomBetween(1.1m, 1.2m, 1); Assert.IsTrue(actual >= 1.1m && actual <= 1.2m); }
public void RandomBetweenTest() { var actual = GeneFactory.RandomBetween(0, 1); Assert.IsTrue(actual < 2); }