コード例 #1
0
        public void TransactionServices_CanGetTransactionsByCriteria()
        {
            // action
            _transactionServices.GetTransactionsByCriteria(new TransactionCriteria());

            // assert
            _transactionBusinessLogic.Verify(x => x.GetByCriteria(It.IsAny <ITransactionCriteria>()), Times.Once);
        }
コード例 #2
0
        public IActionResult Get(
            string currency  = "",
            string startDate = "",
            string endDate   = "",
            string status    = "")
        {
            var criteria = new TransactionCriteriaViewModel(currency, startDate, endDate, status).Convert();

            IList <ITransaction> result = _transactionServices.GetTransactionsByCriteria(criteria);

            return(Ok(result.Select(x => new TransactionViewModel(x))));
        }