public void TestContainsExactLanguage() { var dictionary = new LocalizableStringCollection { "neutralValue", { "de-DE", "germanyValue" } }; dictionary.ContainsExactLanguage(LocalizableString.DefaultLanguage).Should().BeTrue(because: "Unspecified language should default to English generic"); dictionary.ContainsExactLanguage(new CultureInfo("de-DE")).Should().BeTrue(); dictionary.ContainsExactLanguage(new CultureInfo("de")).Should().BeFalse(); dictionary.ContainsExactLanguage(new CultureInfo("de-AT")).Should().BeFalse(); dictionary.ContainsExactLanguage(new CultureInfo("en-US")).Should().BeFalse(); }
public void TestRemoveRange() { var dictionary = new LocalizableStringCollection { "neutralValue", { "de-DE", "germanyValue" }, // Intential duplicates (should be ignored) "neutralValue", { "de-DE", "germanyValue" } }; dictionary.Set(LocalizableString.DefaultLanguage, null); dictionary.ContainsExactLanguage(LocalizableString.DefaultLanguage).Should().BeFalse(because: "Unspecified language should default to English generic"); dictionary.Set(new CultureInfo("de-DE"), null); dictionary.ContainsExactLanguage(new CultureInfo("de-DE")).Should().BeFalse(); }