public void CheckSpeedWithRandomData() { Random rand = new Random(); const int MaximumSpeed = 2; List <int> temp = new List <int>(); for (int i = 0; i < 100000; i++) { temp.Add(rand.Next(0, 100000)); } Stopwatch sw = new Stopwatch(); sw.Start(); XORFind.FindingMaximumXORWithTrie(temp.ToArray()); sw.Stop(); Assert.True(MaximumSpeed > sw.Elapsed.TotalSeconds); }
public void TestIfItWorks(int[] x, int expected) { int result = XORFind.FindingMaximumXORWithTrie(x); Assert.Equal(expected, result); }