public void SetDefaultOntoNonLocalized()
        {
            ITranslatedString str = Create(EnglishString);

            str.Set(Language.English, FrenchString);
            Assert.Equal(FrenchString, str.String);
        }
示例#2
0
        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);
        }
示例#3
0
        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));
        }