Exemple #1
0
        public void String8_IndexOf()
        {
            string  binaryName  = "System.Collections.Generic.List";
            String8 binaryName8 = binaryName.TestConvert();

            Assert.AreEqual(binaryName.IndexOf('.'), binaryName8.IndexOf((byte)'.'));
            Assert.AreEqual(binaryName.IndexOf('.', 18), binaryName8.IndexOf((byte)'.', 18));
            Assert.AreEqual(binaryName.LastIndexOf('.'), binaryName8.LastIndexOf((byte)'.'));
            Assert.AreEqual(binaryName.LastIndexOf('.', 18), binaryName8.LastIndexOf((byte)'.', 18));

            string  collections  = "Collections";
            String8 collections8 = collections.TestConvert();

            Assert.AreEqual(binaryName.IndexOf(collections), binaryName8.IndexOf(collections8));
            Assert.AreEqual(binaryName.IndexOf(collections, 7), binaryName8.IndexOf(collections8, 7));
            Assert.AreEqual(binaryName.IndexOf(collections, 8), binaryName8.IndexOf(collections8, 8));

            string  lists  = "Lists";
            String8 lists8 = lists.TestConvert();

            Assert.AreEqual(binaryName.IndexOf(lists), binaryName8.IndexOf(lists8));
            Assert.AreEqual(binaryName.IndexOf(lists, 28), binaryName8.IndexOf(lists8, 28));

            string  list  = "List";
            String8 list8 = list.TestConvert();

            Assert.AreEqual(binaryName.IndexOf(list), binaryName8.IndexOf(list8));
            Assert.AreEqual(binaryName.IndexOf(list, 20), binaryName8.IndexOf(list8, 20));
            Assert.AreEqual(binaryName.IndexOf(list, 28), binaryName8.IndexOf(list8, 28));
        }
        public void String8_IndexOf()
        {
            string  binaryName  = "System.Collections.Generic.List";
            String8 binaryName8 = String8.Convert(binaryName, new byte[String8.GetLength(binaryName)]);

            Assert.AreEqual(binaryName.IndexOf('.'), binaryName8.IndexOf((byte)'.'));
            Assert.AreEqual(binaryName.IndexOf('.', 18), binaryName8.IndexOf((byte)'.', 18));
            Assert.AreEqual(binaryName.LastIndexOf('.'), binaryName8.LastIndexOf((byte)'.'));
            Assert.AreEqual(binaryName.LastIndexOf('.', 18), binaryName8.LastIndexOf((byte)'.', 18));
        }