示例#1
0
        public void Expenses_OnExecute_ReturnExpensesType()
        {
            //Arrange
            ExpensesController controller = new ExpensesController(_repo, _logger);

            //Act
            var inputDataSource = controller.Expenses();
            var requestResult   = inputDataSource as OkObjectResult;

            //Assert
            Assert.IsInstanceOfType(requestResult, typeof(OkObjectResult));
        }
示例#2
0
        public void Expenses_OnExecute_ReturnExpenses()
        {
            //Arrange
            ExpensesController controller = new ExpensesController(_repo, _logger);

            //Act
            var            inputDataSource = controller.Expenses();
            var            requestResult   = inputDataSource as OkObjectResult;
            List <Expense> txnList         = (List <Expense>)requestResult.Value;

            //Assert
            Assert.AreEqual(2, txnList.Count);
            CollectionAssert.AreEqual(_repo.GetExpenses().ToList(), txnList, new ExpenseComparer());
        }