public void IsSortable(string text) { foreach (var iteration in Benchmark.Iterations) { using (iteration.StartMeasurement()) { CompareInfo.IsSortable(text); } } }
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)); } }
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)); } }
public bool IsSortable(string text) => CompareInfo.IsSortable(text);