public async Task GetSheet_WhenSheetNameIsEmptyAndLangIsEn_ReturnsDataOfFirstSheet() { // arrange var i18nLocalStore = new I18nLocalStore(System.IO.Path.GetRandomFileName()); await i18nLocalStore.SaveSheets(_sheets); // act & assert Assert.ThrowsAsync <ArgumentNullException>( async() => await i18nLocalStore.GetSheet(_spreadsheetId, "") ); }
public async Task GetSheet_WhenSheetNameIsUnknown_ReturnsNull() { // arrange var i18nLocalStore = new I18nLocalStore(System.IO.Path.GetRandomFileName()); await i18nLocalStore.SaveSheets(_sheets); // act var sheet = await i18nLocalStore.GetSheet(_spreadsheetId, "NonExistingSheetName"); // assert Assert.IsNull(sheet); }
public async Task GetSheet_WhenLangIsEn_ReturnsEnglishData() { // arrange var i18nLocalStore = new I18nLocalStore(System.IO.Path.GetRandomFileName()); await i18nLocalStore.SaveSheets(_sheets); // act var i18nSheet = await i18nLocalStore.GetSheet(_spreadsheetId, "Global"); // assert var objectTree = i18nSheet.GetTranslations("en"); Assert.AreEqual("Home", objectTree.GetOrCreateScope("navbar")["home"].ToString()); }