Пример #1
0
        public void TestIndexOfStringRefInQStringRef()
        {
            var r1         = new Random();
            var i1         = r1.Next(0, 60);
            var netString1 = Helper.RandomString(i1);
            var qString1   = new QStringRef(netString1);

            var r      = new Random();
            var rx     = r.Next(0, netString1.Count());
            var charac = netString1.ElementAt(rx);
            var net    = netString1.IndexOf(charac);

            var q = qString1.IndexOf(new string(charac, 1));

            Assert.AreEqual(net, q);
        }
Пример #2
0
        public void TestIndexOfQCharInQStringRefCaseSensitiveWithStartIndex()
        {
            var r1         = new Random();
            var i1         = r1.Next(10, 60);
            var netString1 = Helper.RandomString(i1);
            var qString1   = new QStringRef(netString1);

            var r      = new Random();
            var rx     = r.Next(0, netString1.Count());
            var charac = netString1.ElementAt(rx);
            var net    = netString1.IndexOf(charac, 5);

            var qChar = new QChar(charac);
            var q     = qString1.IndexOf(qChar, 5);

            Assert.AreEqual(net, q);
        }
Пример #3
0
        public void TestIndexOfQStringRefInQStringRefCaseInsensitiveWithStartIndex()
        {
            var r1         = new Random();
            var i1         = r1.Next(10, 60);
            var netString1 = Helper.RandomString(i1);
            var qString1   = new QStringRef(netString1);

            var r      = new Random();
            var rx     = r.Next(0, netString1.Count());
            var charac = netString1.ElementAt(rx);
            var net    = netString1.IndexOf(new string(charac, 1), 5, StringComparison.Ordinal);

            var qChar = new QStringRef(new string(charac, 1));
            var q     = qString1.IndexOf(qChar, 5, CaseSensitivity.CaseInsensitive);

            Assert.AreEqual(net, q);
        }
Пример #4
0
        public void TestIndexOfQStringRefInQStringRefCaseSensitive()
        {
            var r1         = new Random();
            var i1         = r1.Next(0, 60);
            var netString1 = Helper.RandomString(i1);
            int net;
            int q;

            using (var qString1 = new QStringRef(netString1))
            {
                var r      = new Random();
                var rx     = r.Next(0, netString1.Length);
                var charac = netString1.ElementAt(rx);
                net = netString1.IndexOf(charac);

                using (var qChar = new QStringRef(new string(charac, 1)))
                {
                    q = qString1.IndexOf(qChar);
                }
            }

            Assert.AreEqual(net, q);
        }
Пример #5
0
        public void TestIndexOfQCharInQStringRefCaseInsensitiveWithStartIndex()
        {
            var r1         = new Random();
            var i1         = r1.Next(10, 60);
            var netString1 = Helper.RandomString(i1);
            int net;
            int q;

            using (var qString1 = new QStringRef(netString1))
            {
                var r      = new Random();
                var rx     = r.Next(0, netString1.Length);
                var charac = netString1.ElementAt(rx);
                net = netString1.IndexOf(new string(charac, 1), 3, StringComparison.OrdinalIgnoreCase);

                using (var qChar = new QChar(charac))
                {
                    q = qString1.IndexOf(qChar, 3, CaseSensitivity.CaseInsensitive);
                }
            }

            Assert.AreEqual(net, q);
        }
Пример #6
0
        public void TestIndexOfStringRefInQStringRef()
        {
            var r1 = new Random();
            var i1 = r1.Next(0, 60);
            var netString1 = Helper.RandomString(i1);
            var qString1 = new QStringRef(netString1);

            var r = new Random();
            var rx = r.Next(0, netString1.Count());
            var charac = netString1.ElementAt(rx);
            var net = netString1.IndexOf(charac);

            var q = qString1.IndexOf(new string(charac, 1));

            Assert.AreEqual(net, q);
        }
Пример #7
0
        public void TestIndexOfQStringRefInQStringRefCaseInsensitiveWithStartIndex()
        {
            var r1 = new Random();
            var i1 = r1.Next(10, 60);
            var netString1 = Helper.RandomString(i1);
            var qString1 = new QStringRef(netString1);

            var r = new Random();
            var rx = r.Next(0, netString1.Count());
            var charac = netString1.ElementAt(rx);
            var net = netString1.IndexOf(new string(charac, 1), 5, StringComparison.Ordinal);

            var qChar = new QStringRef(new string(charac, 1));
            var q = qString1.IndexOf(qChar, 5, CaseSensitivity.CaseInsensitive);

            Assert.AreEqual(net, q);
        }
Пример #8
0
        public void TestIndexOfQCharInQStringRefCaseSensitiveWithStartIndex()
        {
            var r1 = new Random();
            var i1 = r1.Next(10, 60);
            var netString1 = Helper.RandomString(i1);
            var qString1 = new QStringRef(netString1);

            var r = new Random();
            var rx = r.Next(0, netString1.Count());
            var charac = netString1.ElementAt(rx);
            var net = netString1.IndexOf(charac, 5);

            var qChar = new QChar(charac);
            var q = qString1.IndexOf(qChar, 5);

            Assert.AreEqual(net, q);
        }