示例#1
0
        public void LoadTransactions_with_NullSheetApiResponses_returns_EmptyTrnsactionLists()
        {
            var sheetApiMock = SheetApiMocker.GetMock();

            sheetApiMock.Setup(x => x.LoadRange(It.IsAny <string>(), It.IsAny <string>()))
            .Returns((IList <IList <Object> >)null);
            var repo = GetMonthRepo(sheetApi: sheetApiMock.Object);

            var result = repo.LoadTransactions();

            Assert.NotNull(result);
            Assert.NotNull(result.Expenses);
            Assert.NotNull(result.Income);
            Assert.Empty(result.Expenses);
            Assert.Empty(result.Income);
        }
示例#2
0
 private static IMonthSheetRepository GetMonthRepo(IOptions <MonthSheetDetails> sheetDetails = null, ISheetApiService sheetApi = null)
 {
     return(new MonthSheetRepository(sheetDetails ?? MonthSheetDetailMocker.GetPassing(), sheetApi ?? SheetApiMocker.GetService()));
 }