示例#1
0
        public void GetBudgetList()
        {
            BudgetRequest secondBudgetRequest = new BudgetRequest
            {
                StartDate   = new DateTime(2030, 05, 06),
                EndDate     = new DateTime(2040, 04, 17),
                Amount      = 123.5,
                BudgetItems = new List <BudgetItemRequest>()
            };

            Budget firstBudget  = budgetService.CreateBudget(budgetRequest);
            Budget secondBudget = budgetService.CreateBudget(secondBudgetRequest);

            var           result     = controller.GetBudgetList();
            List <Budget> budgetList = (List <Budget>)result.Value;

            Assert.True(budgetList.Exists(b => b.BudgetId.Equals(firstBudget.BudgetId) &&
                                          b.Amount.Equals(firstBudget.Amount)
                                          ));
            Assert.True(budgetList.Exists(b => b.BudgetId.Equals(secondBudget.BudgetId) &&
                                          b.Amount.Equals(secondBudget.Amount)));
        }