예제 #1
0
 public void IsSortable(string text)
 {
     foreach (var iteration in Benchmark.Iterations)
     {
         using (iteration.StartMeasurement())
         {
             CompareInfo.IsSortable(text);
         }
     }
 }
예제 #2
0
        public void IndexOfTest(string source, bool hasSurrogate, bool expected)
        {
            Assert.Equal(expected, CompareInfo.IsSortable(source));

            bool charExpectedResults = hasSurrogate ? false : expected;

            foreach (char c in source)
            {
                Assert.Equal(charExpectedResults, CompareInfo.IsSortable(c));
            }
        }
예제 #3
0
        public void IsSortableTest(object sourceObj, bool expected)
        {
            string source = sourceObj as string ?? new string((char[])sourceObj);

            Assert.Equal(expected, CompareInfo.IsSortable(source));

            // If the string as a whole is sortable, then all chars which aren't standalone
            // surrogate halves must also be sortable.

            foreach (char c in source)
            {
                Assert.Equal(expected && !char.IsSurrogate(c), CompareInfo.IsSortable(c));
            }
        }
예제 #4
0
 public bool IsSortable(string text)
 => CompareInfo.IsSortable(text);