Exemple #1
0
        public void Map_WhenLangListIsEmpty_ReturnsEmptyList()
        {
            // arrange
            var valueRange = new ValueRange
            {
                Values = new List <IList <object> >
                {
                    new List <object> {
                        "ID"
                    },
                    new List <object> {
                        "btn.Word", "Слово", "word"
                    },
                    new List <object> {
                        "btn.Work", "Работа", "work"
                    },
                    new List <object> {
                        "Work", "Работа", "work"
                    }
                }
            };

            // act
            var languages = new I18nSupportedLanguagesMapper().Map(valueRange);

            // assert
            CollectionAssert.IsEmpty(languages);
        }
Exemple #2
0
        public void Map_WhenLangListIsDefined_ReturnsLanguages()
        {
            // arrange
            var valueRange = new ValueRange
            {
                Values = new List <IList <object> >
                {
                    new List <object> {
                        "ID", "ru", "en", "ua"
                    },
                    new List <object> {
                        "btn.Word", "Слово", "word"
                    },
                    new List <object> {
                        "btn.Work", "Работа", "work"
                    },
                    new List <object> {
                        "Work", "Работа", "work"
                    }
                }
            };

            // act
            var languages = new I18nSupportedLanguagesMapper().Map(valueRange);

            // assert
            CollectionAssert.AreEqual(new[] { "ru", "en", "ua" }, languages);
        }
Exemple #3
0
        public I18nSheet(string spreadsheetId, string sheetName, ValueRange valueRange)
        {
            _i18nObjectTreeForLanguageMapper = new I18nObjectTreeForLanguageMapper();
            _i18nSupportedLanguagesMapper    = new I18nSupportedLanguagesMapper();

            SpreadsheetId = spreadsheetId;
            SheetName     = sheetName;
            ValueRange    = valueRange;
        }