public void Get_Success() { Dictionary <string, string> syntax = new Dictionary <string, string>(); IName n = new CompoundName(string.Empty, syntax); n.Add("item1"); n.Add("item2"); n.Add("item3"); Assert.AreSame("item2", n.Get(1)); }
public void EndsWithName_Fail() { Dictionary <string, string> syntax = new Dictionary <string, string>(); IName nEnd = new CompoundName("item1", syntax); IName n = new CompoundName(string.Empty, syntax); n.Add("item1"); n.Add("item2"); Assert.IsFalse(n.EndsWith(nEnd)); }
public void IsEmpty_False() { Dictionary <string, string> syntax = new Dictionary <string, string>(); IName n = new CompoundName(string.Empty, syntax); n.Add("item1"); Assert.IsFalse(n.IsEmpty()); }
public void AddName_ok() { Dictionary <string, string> syntax = new Dictionary <string, string>(); IName n2 = new CompoundName("item2", syntax); IName n = new CompoundName(string.Empty, syntax); n.Add(n2); n.Add("item1"); IEnumerable <string> r = n.GetAll(); IEnumerator <string> enumerator = r.GetEnumerator(); enumerator.MoveNext(); Assert.AreSame("item2", enumerator.Current); enumerator.MoveNext(); Assert.AreSame("item1", enumerator.Current); Assert.IsFalse(enumerator.MoveNext()); }