public Equals ( |
||
other | /// The other frequency dictionary. /// | |
return | bool |
public bool Equals(FrequencyDictionary other)
{
if (other.Count != words.Count)
{
return false;
}
for (int index = 0; index < Count; index++)
{
if (!other.Contains(GetWord(index)))
{
return false;
}
}
return true;
}
public void CloneTest() { string str = chain.ToString(); var alphabet1 = new FrequencyDictionary(str); var alphabet2 = new FrequencyDictionary(chain); FrequencyDictionary alphabet3 = alphabet2.Clone(); Assert.True(alphabet1.Equals(alphabet2) && alphabet3.Equals(alphabet1)); }