public void SetDefaultOntoNonLocalized() { ITranslatedString str = Create(EnglishString); str.Set(Language.English, FrenchString); Assert.Equal(FrenchString, str.String); }
public void RemoveThenAdd() { TranslatedString.DefaultLanguage = Language.English; ITranslatedString str = Create( new KeyValuePair <Language, string>(Language.English, EnglishString), new KeyValuePair <Language, string>(Language.French, FrenchString)); str.RemoveNonDefault(Language.French); str.Set(Language.French, "Hmm"); Assert.True(str.TryLookup(Language.French, out var outStr)); Assert.Equal("Hmm", outStr); }
public void Set() { TranslatedString.DefaultLanguage = Language.English; ITranslatedString str = Create(EnglishString); str.Set(Language.French, FrenchString); // English string Assert.Equal(EnglishString, str.String); Assert.True(str.TryLookup(Language.English, out var outStr)); Assert.Equal(EnglishString, outStr); Assert.Equal(EnglishString, str.Lookup(Language.English)); // French string Assert.True(str.TryLookup(Language.French, out outStr)); Assert.Equal(FrenchString, outStr); Assert.Equal(FrenchString, str.Lookup(Language.French)); }