Example #1
0
        public void GetListOfActiveTransactions_WhenNoInputValues_ReturnList_Test()
        {
            // Arrange

            // Act
            var result = _service.GetListOfActiveTransactions();

            // Assert
            Assert.IsInstanceOf(typeof(List <Business.Models.AccountTransaction>), result, "Result Type");
            Assert.That(result, Is.TypeOf <Business.Models.AccountTransaction>());
            Assert.IsNotNull(result, "Asset Transaction List");
        }
Example #2
0
        public void GetListOfActiveTransactions_WhenAccountTransactionListHasAccountTransactions_ShouldCallUnitOfWorkRepositoryAssetSettingsMethodGetActive_Test()
        {
            _mockUnitOfWork = new Mock <IUnitOfWork>();
            Setup_MockUnitOfWork_AssetTransaction_GetAllActiveByDueDate();
            Setup_MockUnitOfWork_Assets_Get();
            Setup_MockUnitOfWork_AssetTypes_Get();
            Setup_MockUnitOfWork_AssetSettings_GetActive();

            _service = new AccountTransactionService(_mockUnitOfWork.Object);

            _service.GetListOfActiveTransactions();

            _mockUnitOfWork.Verify(uow => uow.AssetSettings.GetActive(It.IsAny <int>(), It.IsAny <int>()),
                                   Times.AtLeastOnce);
        }
Example #3
0
        public void GetListOfActiveTransactions_WhenCalled_ShouldCallOneTimeUnitOfWorkRepositoryAssetTransactionsMethodGetAllActiveByDueDate_Test()
        {
            _mockUnitOfWork = new Mock <IUnitOfWork>();
            Setup_MockUnitOfWork_AssetTransaction_GetAllActiveByDueDate();
            Setup_MockUnitOfWork_Assets_Get();
            Setup_MockUnitOfWork_AssetTypes_Get();
            Setup_MockUnitOfWork_AssetSettings_GetActive();

            _service = new AccountTransactionService(_mockUnitOfWork.Object);

            _service.GetListOfActiveTransactions();

            _mockUnitOfWork.Verify(uow => uow.AssetTransactions.GetAllActiveByDueDate(),
                                   Times.Once);
        }
Example #4
0
        public void GetListOfActiveTransactions_WhenCalled_ReturnAccountTransactionList_Test()
        {
            var result = _service.GetListOfActiveTransactions();

            Assert.That(result, Is.TypeOf <List <AccountTransaction> >());
        }