Пример #1
0
        public void InsertStringAtPosition_ok()
        {
            Dictionary <string, string> syntax = new Dictionary <string, string>();
            IName n = new CompoundName(string.Empty, syntax);

            n.Insert(0, "item1");

            IEnumerable <string> r          = n.GetAll();
            IEnumerator <string> enumerator = r.GetEnumerator();

            enumerator.MoveNext();
            Assert.AreSame("item1", enumerator.Current);

            Assert.IsFalse(enumerator.MoveNext());
        }
Пример #2
0
        public void DivideNameWithSpacesBySeparator_DonotTrim_FoundCoupleNameComponents()
        {
            Dictionary <string, string> syntax = new Dictionary <string, string>()
            {
                { "separator", ";" }
            };

            IName n = new CompoundName("itemA ; itemB; itemC ", syntax);

            IEnumerable <string> r          = n.GetAll();
            IEnumerator <string> enumerator = r.GetEnumerator();

            enumerator.MoveNext();
            Assert.AreEqual("itemA ", enumerator.Current);

            enumerator.MoveNext();
            Assert.AreEqual(" itemB", enumerator.Current);

            enumerator.MoveNext();
            Assert.AreEqual(" itemC ", enumerator.Current);

            Assert.IsFalse(enumerator.MoveNext());
        }