public void CheckPrimality_NumberIs449() { var test = new RabinMillerTest(447); var number = CreateNumber(193, 1); Assert.IsTrue(test.CheckPrimality(number)); }
public void CheckPrimality_NumberIs257() { var test = new RabinMillerTest(255); var number = CreateNumber(1, 1); Assert.IsTrue(test.CheckPrimality(number)); }
public void CheckPrimality_NumberIs6() { var test = new RabinMillerTest(4); var number = CreateNumber(6); Assert.IsFalse(test.CheckPrimality(number)); }
public void CheckPrimality3() { var test = new RabinMillerTest(CreateNumber(2)); var number = CreateNumber(37); Assert.IsTrue(test.CheckPrimality(number)); }
public void CheckPrimality1() { for (var i = 5; i < 500; ++i) { var test = new RabinMillerTest(i - 2); var result = test.CheckPrimality(BigNumber.FromInt(i)); if (result != CheckPrimality(i)) { Assert.Fail("Error: " + i); } } }
public void CheckPrimality_NumberIsNull() { var test = new RabinMillerTest(2); Assert.Throws(typeof(ArgumentNullException), () => test.CheckPrimality(null)); }