public void FindUsingPrimeNumberHashingEmptyListIfNull() { var anagram = new Anagram(null); var result = anagram.FindUsingPrimeNumberHashing(); Assert.IsNotNull(result); Assert.AreEqual(0, result.Count()); }
public void EmptyListIfNull() { var anagram = new Anagram(null); var result = anagram.FindUsingSorting(); Assert.IsNotNull(result); Assert.AreEqual(0, result.Count()); }
public void FindUsingPrimeNumberHashingOneAnagram() { var anagram = new Anagram(new[] { "word", "drwo" }); var result = anagram.FindUsingPrimeNumberHashing(); Assert.IsNotNull(result); Assert.AreEqual(1, result.Count()); Assert.AreEqual(2, result.ElementAt(0).Count()); Assert.AreEqual("word", result.ElementAt(0).ElementAt(0)); Assert.AreEqual("drwo", result.ElementAt(0).ElementAt(1)); }
public void OneWord() { var anagram = new Anagram(new[] { "word" }); var result = anagram.FindUsingSorting(); Assert.IsNotNull(result); Assert.AreEqual(1, result.Count()); Assert.AreEqual(1, result.ElementAt(0).Count()); Assert.AreEqual("word", result.ElementAt(0).ElementAt(0)); }
public void OneAnagramMixedOrder() { var anagram = new Anagram(new[] { "word", "sdsad", "drwo" }); var result = anagram.FindUsingSorting(); Assert.IsNotNull(result); Assert.AreEqual(2, result.Count()); Assert.AreEqual(2, result.ElementAt(0).Count()); Assert.AreEqual("word", result.ElementAt(0).ElementAt(0)); Assert.AreEqual("drwo", result.ElementAt(0).ElementAt(1)); Assert.AreEqual(1, result.ElementAt(1).Count()); Assert.AreEqual("sdsad", result.ElementAt(1).ElementAt(0)); }
public void MultipleAnagram() { var anagram = new Anagram(new[] { "word", "wdro", "drwo" }); var result = anagram.FindUsingSorting(); Assert.IsNotNull(result); Assert.AreEqual(1, result.Count()); Assert.AreEqual(3, result.ElementAt(0).Count()); Assert.AreEqual("word", result.ElementAt(0).ElementAt(0)); Assert.AreEqual("wdro", result.ElementAt(0).ElementAt(1)); Assert.AreEqual("drwo", result.ElementAt(0).ElementAt(2)); }