public void GetNodByStein_params6_9_12_Expected_3() { NOD nodEvklid = new NOD(); int actual = nodEvklid.GetNodByStein(6, 9, 12); int expected = 3; Assert.AreEqual(actual, expected); }
public void TestMethod2() { int a = 300181; int b = 223744; int nod = 19; int ans = NOD.EuclidAlg(a, b); Assert.AreEqual(nod, ans); }
public void BinEvklidNODArray7_3_12Exp1() { NOD nod = new NOD(new[] { 7, 3, 12 }); int exp = 1; //Act uint fact = nod.BinaryGCD(); //Assert Assert.AreEqual(exp, fact); }
public void TestMethod3() { int a = 585; int b = 81; int c = 189; int nod = 9; int ans = NOD.EuclidAlg(a, b, c); Assert.AreEqual(nod, ans); }
public void TestMethod1() { int a = 322328; int b = 122120; int nod = 344; int ans = NOD.EuclidAlg(a, b); Assert.AreEqual(nod, ans); }
public void TestNODBin() { int a = 16; int b = 8; int expected = 8; NOD n = new NOD(); int actual = n.nodBin(a, b); Assert.AreEqual(expected, actual); }
public void TestMethod4() { int a = 78; int b = 294; int c = 570; int d = 36; int nod = 6; int ans = NOD.EuclidAlg(a, b, c, d); Assert.AreEqual(nod, ans); }
public void BinEvklidNODArray12_Negative69_27Exp3() { //Arrange NOD nod = new NOD(new[] { 12, -69, 27 }); int exp = 3; //Act uint fact = nod.BinaryGCD(); //Assert Assert.AreEqual(exp, fact); }
public void EvklidNODArray12_69_27Exp3() { //Arrange NOD nod = new NOD(new [] { 12, 69, 27 }); int exp = 3; //Act int fact = nod.EvklidNOD(); //Assert Assert.AreEqual(exp, fact); }
public void TestNODEv2() { int a = 45; int b = 15; int expected = 15; NOD n = new NOD(); int actual = n.nodEv(a, b); Assert.AreEqual(expected, actual); }
public void EvklidNODArray12_0_27ExpNegative1() { //Arrange NOD nod = new NOD(new[] { 12, 0, 27 }); int exp = -1; //Act int fact = nod.EvklidNOD(); //Assert Assert.AreEqual(exp, fact); }
public void BinEvklidNODArray12_0_0ExpNegative12() { //Arrange NOD nod = new NOD(new[] { 12, 0, 0 }); int exp = 12; //Act uint fact = nod.BinaryGCD(); //Assert Assert.AreEqual(exp, fact); }
public void TestNODEv4() { int a = 45; int b = 15; int c = 10; int d = 5; int expected = 5; NOD n = new NOD(); int actual = n.nodEv(a, b, c, d); Assert.AreEqual(expected, actual); }
public void TestNODEv5() { int a = 55; int b = 121; int c = 11; int d = 22; int e = 33; int expected = 11; NOD n = new NOD(); int actual = n.nodEv(a, b, c, d, e); Assert.AreEqual(expected, actual); }
public void TestMethodGcdStein() { double time; int a, b, gcd; for (int i = 0; i < 100; i++) { time = 0; a = rand.Next(-1000, 1001); b = rand.Next(-1000, 1001); gcd = NOD.findGcdStein(a, b, ref time); Assert.IsTrue(CheckResult(gcd, a, b)); } }
public void TestMethodGcdEuclid() { double time; int a, b, c, d, e, gcd; for (int i = 0; i < 100; i++) { time = 0; a = rand.Next(-1000, 1001); b = rand.Next(-1000, 1001); c = rand.Next(-1000, 1001); d = rand.Next(-1000, 1001); e = rand.Next(-1000, 1001); gcd = NOD.findGcdEuclid(a, b, c, d, e, ref time); Assert.IsTrue(CheckResult(gcd, a, b, c, d, e)); } }
public long Stein_3Args(long a, long b, long c) { return(NOD.Stein(a, b)); }
public long Stein_2Args(long a, long b) { return(NOD.Stein(a, b)); }
public void Euclid_ManyArgs_ThrowsArgumentOutOfRangeException(long a, long b, long c, long d, long e) { Assert.Throws <ArgumentOutOfRangeException>(() => NOD.Euclid(a, b, c, d, e)); }
public long Euclid_ManyArgs(long a, long b, long c, long d, long e) { return(NOD.Euclid(a, b, c, d, e)); }
public void Euclid_3Args_ThrowsArgumentOutOfRangeException(long a, long b, long c) { Assert.Throws <ArgumentOutOfRangeException>(() => NOD.Euclid(a, b, c)); }
public long Euclid_3Args(long a, long b, long c) { return(NOD.Euclid(a, b)); }
public void SteinAlgorithmArgumentNullTests() => Assert.Throws <ArgumentNullException>(() => NOD.SteinAlgorithm(null));
public int EuclidAlgorithmTests(params int[] values) => NOD.EuclidAlgorithm(values);
public int SteinAlgorithmTests(int value1, int value2, int value3) => NOD.SteinAlgorithm(value1, value2, value3);
public int SteinAlgorithmTests(params int[] values) => NOD.SteinAlgorithm(values);
public void Stein_3Args_ThrowsArgumentOutOfRangeException(long a, long b, long c) { Assert.Throws <ArgumentOutOfRangeException>(() => NOD.Stein(a, b, c)); }
public long Euclid_2Args(long a, long b) { return(NOD.Euclid(a, b)); }
public long Stein_ManyArgs(long a, long b, long c, long d, long e) { return(NOD.Stein(a, b, c, d, e)); }
public void SteinAlgorithmArgumentOutOfRangeTests(int value) => Assert.Throws <ArgumentOutOfRangeException>(() => NOD.SteinAlgorithm(value));