public void DELIntegerRandomMaxValueTest() { BELInteger source = new BELInteger(0); int maxValue = int.MaxValue; int minValue = 0; int result = source.Random(1, maxValue - 1); Assert.Less(result, maxValue, "1 - Checking that BELInteger(0).Random(1, " + ((int)(maxValue - 1)).ToString() + ") < " + ((int)(maxValue - 1)).ToString()); Assert.Greater(result, minValue, "1 - Checking that BELInyeger(0).Random(1, " + ((int)(maxValue - 1)).ToString() + ") > 0"); result = source.Random(1, maxValue - 1); Assert.Less(result, maxValue, "2 - Checking that BELInteger(0).Random(1, " + ((int)(maxValue - 1)).ToString() + ") < " + ((int)(maxValue - 1)).ToString()); Assert.Greater(result, minValue, "2 - Checking that BELInyeger(0).Random(1, " + ((int)(maxValue - 1)).ToString() + ") > 0"); result = source.Random(1, maxValue - 1); Assert.Less(result, maxValue, "3 - Checking that BELInteger(0).Random(1, " + ((int)(maxValue - 1)).ToString() + ") < " + ((int)(maxValue - 1)).ToString()); Assert.Greater(result, minValue, "3 - Checking that BELInyeger(0).Random(1, " + ((int)(maxValue - 1)).ToString() + ") > 0"); result = source.Random(1, maxValue - 1); Assert.Less(result, maxValue, "4 - Checking that BELInteger(0).Random(1, " + ((int)(maxValue - 1)).ToString() + ") < " + ((int)(maxValue - 1)).ToString()); Assert.Greater(result, minValue, "4 - Checking that BELInyeger(0).Random(1, " + ((int)(maxValue - 1)).ToString() + ") > 0"); result = source.Random(1, maxValue - 1); Assert.Less(result, maxValue, "5 - Checking that BELInteger(0).Random(1, " + ((int)(maxValue - 1)).ToString() + ") < " + ((int)(maxValue - 1)).ToString()); Assert.Greater(result, minValue, "5 - Checking that BELInyeger(0).Random(1, " + ((int)(maxValue - 1)).ToString() + ") > 0"); }
public void BELIntegerRandomRangeTest() { BELInteger source = new BELInteger(0); int maxValue = 11; int minValue = 0; int result = source.Random(1, 10); Assert.Less(result, maxValue, "1 - Checking that BELInteger(0).Random(1, 10) < 10"); Assert.Greater(result, minValue, "1 - Checking that BELInyeger(0).Random(1, 10) > 0"); result = source.Random(1, 10); Assert.Less(result, maxValue, "2 - Checking that BELInteger(0).Random(1, 10) < 10"); Assert.Greater(result, minValue, "2 - Checking that BELInyeger(0).Random(1, 10) > 0"); result = source.Random(1, 10); Assert.Less(result, maxValue, "3 - Checking that BELInteger(0).Random(1, 10) < 10"); Assert.Greater(result, minValue, "3 - Checking that BELInyeger(0).Random(1, 10) > 0"); result = source.Random(1, 10); Assert.Less(result, maxValue, "4 - Checking that BELInteger(0).Random(1, 10) < 10"); Assert.Greater(result, minValue, "4 - Checking that BELInyeger(0).Random(1, 10) > 0"); result = source.Random(1, 10); Assert.Less(result, maxValue, "5 - Checking that BELInteger(0).Random(1, 10) < 10"); Assert.Greater(result, minValue, "5 - Checking that BELInyeger(0).Random(1, 10) > 0"); }