Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
        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());
        }
Ejemplo n.º 4
0
        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());
        }