Esempio n. 1
0
        public void ToArray_Straight()
        {
            TranslatedString.DefaultLanguage = Language.English;
            ITranslatedString str = Create(EnglishString);
            var arr = str.ToArray();

            Assert.Single(arr);
            Assert.Equal(Language.English, arr[0].Key);
            Assert.Equal(EnglishString, arr[0].Value);
        }
Esempio n. 2
0
        public void ToArray_MultiLanguage()
        {
            TranslatedString.DefaultLanguage = Language.English;
            ITranslatedString str = Create(
                new KeyValuePair <Language, string>(Language.English, EnglishString),
                new KeyValuePair <Language, string>(Language.French, FrenchString));

            var arr = str.ToArray();

            Assert.Equal(2, arr.Length);
            Assert.Equal(Language.English, arr[0].Key);
            Assert.Equal(EnglishString, arr[0].Value);
            Assert.Equal(Language.French, arr[1].Key);
            Assert.Equal(FrenchString, arr[1].Value);
        }