public void TestMethod1() { Ana a = new Ana(); List <string> test = new List <string>() { "em", "me", "to" }; int finalCount = a.anagrams(test); Assert.AreEqual(1, finalCount); }
public void TestMethod2() { Ana a = new Ana(); List <string> test = new List <string>() { "tape", "rate", "seat", "pate", "east", "pest" }; int finalCount = a.anagrams(test); Assert.AreEqual(2, finalCount); }
public void TestMetho6() { Ana a = new Ana(); Rando r = new Rando(); int x = r.RandomNumLengthofArray(100000); int y = r.RandomNumLengthofWords(10000); int z = r.RandomNumOfAnagrams(40000); int fin = x - z; int finalCount = a.anagrams(r.randomGen(x, y, z)); Assert.AreEqual(finalCount, fin); }
public static double Timer() { Rando r = new Rando(); Ana a = new Ana(); Stopwatch sw = new Stopwatch(); double elapsed = 0; long repetitions = 1; int size = 32; do { repetitions *= 2; int _x = r.RandomNumLengthofArray(size); int _y = r.RandomNumLengthofWords(100); int _z = r.RandomNumOfAnagrams(size); List <string> Time = r.randomGen(size, _y, _z); sw.Restart(); for (long i = 0; i < repetitions; i++) { double time = a.anagrams(Time); } sw.Stop(); elapsed = msecs(sw); size = size * 2; } while (elapsed < DURATION); double totalAverage = elapsed / repetitions; return(totalAverage); }