Exemplo n.º 1
0
        public async void GetAllIncomesWithDetailsReturnsEnumerableWithIncomes()
        {
            //Given
            using (var db = new ItsomContext(CtxOpt))
            {
                db.Database.EnsureCreated();

                IIncomeDataService service = new IncomeDataService(db);

                db.Incomes.AddRange(Income);

                var save = db.SaveChanges();
                var some = new QueryCondition <Income>();
                some.QueryIncludes.Add(i => i.CashAccount);
                some.QueryOrderBy.Add(i => i.IncomeDate);
                var result = await service.GetAllIncomesWithDetails(some, 2);

                IncomeModel income;
                using (var single = result.GetEnumerator())
                {
                    single.MoveNext();
                    income = single.Current;
                }

                var another = some;
                Assert.NotNull(result);
                Assert.Equal(3, result.Count());
                Assert.IsType <IncomeModel>(income);
            }
        }
Exemplo n.º 2
0
 public IncomesController(IncomeDataService service)
 {
     _service = service;
 }