public void BELIntegerAddNegativeTest()
 {
     BELInteger source = new BELInteger(4);
     int expectedResult = 2;
     int result = source.Add(-2);
     Assert.AreEqual(expectedResult, result, "Checking that BELInteger(4).Add(-2) = 2");
 }
 public void BELIntegerLessThanTest()
 {
     BELInteger left = new BELInteger(4);
     Assert.IsTrue(left.LessThan(5));
     Assert.IsFalse(left.LessThan(4));
     Assert.IsFalse(left.LessThan(3));
 }
 public void BELIntegerLessThanOrEqualToTest()
 {
     BELInteger left = new BELInteger(4);
     Assert.IsTrue(left.LessThanOrEqualTo(5));
     Assert.IsTrue(left.LessThanOrEqualTo(4));
     Assert.IsFalse(left.LessThanOrEqualTo(3));
 }
 public void BELIntegerAddMinValueTest()
 {
     BELInteger source = new BELInteger(int.MinValue);
     int expectedResult = int.MinValue + 10;
     int result = source.Add(10);
     Assert.AreEqual(expectedResult, result, "Checking that BELInteger(int.MinValue).Add(10) works");
 }
 public void BELIntegerAddMinValueNegativeTest()
 {
     BELInteger source = new BELInteger(int.MinValue);
     int min = int.MinValue;
     int expectedResult = min - 10;
     int result = source.Add(-10);
     Assert.AreEqual(expectedResult, result, "Checking that BELInteger(int.MinValue).Add(-10) 'wraps' correctly");
 }
 public void BELIntegerAddMaxValueTest()
 {
     BELInteger source = new BELInteger(int.MaxValue);
     int max = int.MaxValue;
     int expectedResult = max + 10;
     int result = source.Add(10);
     Assert.AreEqual(expectedResult, result, "Checking that BELInteger(int.MaxValue).Add(10) 'wraps' correctly");
 }
 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");
 }
Esempio n. 9
0
		public void BELIntegerMultiplyZeroTest()
		{
			BELInteger source = new BELInteger(4);
			int result = source.Multiply(0);
			Assert.AreEqual(0, result, "Checking that BELInteger(4).Multiply(0) = 0");
		}
Esempio n. 10
0
		public void BELIntegerStringDivideTest()
		{
			BELInteger source = new BELInteger(10);
			int expectedResult = 5;
			int result = source.Divide("2");
			Assert.AreEqual(expectedResult, result, "Checking that BELInteger(10).Divide(\"2\") = 5");
		}
Esempio n. 11
0
		public void BELIntegerDivideMinValueNegativeTest()
		{
			BELInteger source = new BELInteger(int.MinValue);
			int min = int.MinValue;
			int expectedResult = min / -2;
			int result = source.Divide(-2);
			Assert.AreEqual(expectedResult, result, "Checking that BELInteger(int.MinValue).Divide(-2) 'wraps' correctly");
		}
Esempio n. 12
0
		public void BELIntegerDivideNegativeSourceTest()
		{
			BELInteger source = new BELInteger(-4);
			int expectedResult = -2;
			int result = source.Divide(2);
			Assert.AreEqual(expectedResult, result, "Checking that BELInteger(-4).Divide(2) = -8");
		}
Esempio n. 13
0
		public void BELIntegerStringMultiplyTest()
		{
			BELInteger source = new BELInteger(10);
			int expectedResult = 60;
			int result = source.Multiply("6");
			Assert.AreEqual(expectedResult, result, "Checking that BELInteger(10).Multiply(\"6\") = 60");
		}
Esempio n. 14
0
		public void BELIntegerMultiplyMaxValueTest()
		{
			BELInteger source = new BELInteger(int.MaxValue);
			int max = int.MaxValue;
			int expectedResult = max * 2;
			int result = source.Multiply(2);
			Assert.AreEqual(expectedResult, result, "Checking that BELInteger(int.MaxValue).Multiply(2) works");
		}
Esempio n. 15
0
		public void BELIntegerAddStringTest()
		{
			BELInteger source = new BELInteger(4);
			int expectedResult = 10;
			int result = source.Add("6");
			Assert.AreEqual(expectedResult, result, "Checking that BELInteger(4).Add(\"6\") = 10");
		}
Esempio n. 16
0
		public void BELIntegerMultiplyNegativeSourceTest()
		{
			BELInteger source = new BELInteger(-4);
			int expectedResult = -8;
			int result = source.Multiply(2);
			Assert.AreEqual(expectedResult, result, "Checking that BELInteger(-4).Multiply(2) = -8");
		}
Esempio n. 17
0
		public void BELIntegerMultiplyZeroResultTest()
		{
			BELInteger source = new BELInteger(10);
			int expectedResult = 0;
			int result = source.Multiply(0);
			Assert.AreEqual(expectedResult, result, "Checking that BELInteger(10).Multiply(0) = 0");
		}
Esempio n. 18
0
		public void BELIntegerSubtractZeroTest()
		{
			BELInteger source = new BELInteger(4);
			int result = source.Subtract(0);
			Assert.AreEqual(source.Value, result, "Checking that BELInteger(4).Subtract(0) = 4");
		}
Esempio n. 19
0
		public void BELIntegerMultiplyMaxValueNegativeTest()
		{
			BELInteger source = new BELInteger(int.MaxValue);
			int max = int.MaxValue;
			int expectedResult = max * -2;
			int result = source.Multiply(-2);
			Assert.AreEqual(expectedResult, result, "Checkng that BELInteger(int.MaxValue).Multiply(-2) 'wraps' correctly");
		}
Esempio n. 20
0
		public void BELIntegerSubtractNegativeSourceTest()
		{
			BELInteger source = new BELInteger(-4);
			int expectedResult = -6;
			int result = source.Subtract(2);
			Assert.AreEqual(expectedResult, result, "Checking that BELInteger(-4).Subtract(2) = -6");
		}
Esempio n. 21
0
		public void BELIntegerDivideZeroTest()
		{
			BELInteger source = new BELInteger(4);
			int result = source.Divide(0);
		}
Esempio n. 22
0
		public void BELIntegerSubtractZeroResultTest()
		{
			BELInteger source = new BELInteger(10);
			int expectedResult = 0;
			int result = source.Subtract(10);
			Assert.AreEqual(expectedResult, result, "Checking that BELInteger(10).Subtract(10) = 0");
		}
Esempio n. 23
0
		public void BELIntegerDivideMinValueTest()
		{
			BELInteger source = new BELInteger(int.MinValue);
			int min = int.MinValue;
			int expectedResult = min / 2;
			int result = source.Divide(2);
			Assert.AreEqual(expectedResult, result, "Checking that BELInteger(int.MinValue).Divide(2) works");
		}
Esempio n. 24
0
		public void BELIntegerSubtractMaxValueTest()
		{
			BELInteger source = new BELInteger(int.MaxValue);
			int max = int.MaxValue;
			int expectedResult = max - 10;
			int result = source.Subtract(10);
			Assert.AreEqual(expectedResult, result, "Checking that BELInteger(int.MaxValue).Subtract(10) works");
		}
Esempio n. 25
0
		public void BELIntegerDivideByOneTest()
		{
			BELInteger source = new BELInteger(8);
			int result = source.Divide(1);
			Assert.AreEqual(source.Value, result, "Checking that BELInteger(8).Divide(1) = 8");
		}
Esempio n. 26
0
		public void BELIntegerSubtractMaxValueNegativeTest()
		{
			BELInteger source = new BELInteger(int.MaxValue);
			int max = int.MaxValue;
			int expectedResult = max + 10;
			int result = source.Subtract(-10);
			Assert.AreEqual(expectedResult, result, "Checkng that BELInteger(int.MaxValue).Subtract(-10) wraps correctly");
		}
Esempio n. 27
0
		public void BELIntegerStaticAddZeroResultTest()
		{
			BELInteger source = new BELInteger(-10);
			int expectedResult = 0;
			int result = source.Add(10);
			Assert.AreEqual(expectedResult, result, "Checking that BELInteger(-10).Add(10) = 0");
		}
Esempio n. 28
0
		public void BELIntegerStringSubtractTest()
		{
			BELInteger source = new BELInteger(10);
			int expectedResult = 4;
			int result = source.Subtract("6");
			Assert.AreEqual(expectedResult, result, "Checking that BELInteger(10).Subtract(\"6\") = 4");
		}