Exemple #1
0
        public void TestLastIndexOfStringInQStringRef()
        {
            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.LastIndexOf(charac);

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

            Assert.AreEqual(net, q);
        }
        public void TestLastIndexOfQStringRefInQStringRef()
        {
            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.LastIndexOf(charac);

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

            Assert.AreEqual(net, q);
        }
Exemple #3
0
        public void TestLastIndexOfStringInQStringRef()
        {
            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.LastIndexOf(charac);

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

            Assert.AreEqual(net, q);
        }