public void LoadSingle_returns_Single_String() { var sheetApiMock = SheetApiMocker.GetMock(); var goodResponse = "good"; var badResponse = "bad"; sheetApiMock.Setup(x => x.LoadRange(It.IsAny <string>(), It.IsAny <string>())).Returns(new List <IList <object> >() { new List <object>() { goodResponse, badResponse, badResponse }, new List <object>() { badResponse, badResponse, badResponse } }); var repo = GetRepoInstance(sheetApi: sheetApiMock.Object); var result = repo._LoadSingle(new Faker().Lorem.Word()); Assert.NotNull(result); Assert.IsType <string>(result); Assert.Equal(goodResponse, result); }
private static RepoInstance GetRepoInstance(string sheetId = null, ISheetApiService sheetApi = null) { return(new RepoInstance(sheetId ?? new Faker().Lorem.Word(), sheetApi ?? SheetApiMocker.GetService())); }
private static SheetRepositoryBase GetRepoBase(string sheetId = null, ISheetApiService sheetApi = null) { return(new SheetRepositoryBase(sheetId ?? new Faker().Lorem.Word(), sheetApi ?? SheetApiMocker.GetService())); }