public void CreateMappingTable_returns_the_same_array_as_prev_if_has_the_same_order() { var invariant = MappingCache.GetMapping(CultureInfo.InvariantCulture, false); var sameAsInvariant = MappingCache.GetMapping(CultureInfo.GetCultureInfo("en-US"), false); var sameAsInvariant2 = MappingCache.GetMapping(CultureInfo.GetCultureInfo("en-GB"), false); invariant.Should().BeSameAs(sameAsInvariant); invariant.Should().BeSameAs(sameAsInvariant2); }
private NaturalStringComparer(CompareOptions options, CultureInfo culture = null) { _options = options; _ignoreCase = _options.HasFlag(CompareOptions.IgnoreCase); _culture = culture; if (culture != null) { _mappings = MappingCache.GetMapping(culture, _ignoreCase); } else { _mappings = Array.Empty <ushort>(); } }