Exemple #1
0
        public void IndexOf()
        {
            var list   = new List <char>(Globals.Chars);
            var system = new S.List <char>(Globals.Chars);

            Comparer <char> .Compare(list, system);

            for (char c = '\0'; c < char.MaxValue; c++)
            {
                if (list.IndexOf(c) != system.IndexOf(c))
                {
                    Assert.Fail();
                }
            }

            Comparer <char> .Compare(list, system);
        }
Exemple #2
0
        public void IndexOf()
        {
            var vector = new Vector <char>(Globals.Chars);
            var system = new S.List <char>(Globals.Chars);

            Comparer <char> .Compare(vector, system);

            for (int i = 0; i < Globals.Chars.Length; i++)
            {
                Assert.IsTrue(vector.IndexOf(Globals.Chars[i]) == i);
            }

            for (int i = 0; i < Globals.Chars.Length; i++)
            {
                Assert.IsTrue(vector.IndexOf(system[i]) == i);
            }

            Assert.IsTrue(vector.IndexOf(' ') == system.IndexOf(' '));

            Comparer <char> .Compare(vector, system);
        }