Exemplo n.º 1
0
        public void ShouldThrowExceptionIfCantFindTransaction()
        {
            // Arrange
            var transactionTableRepository = Substitute.For <ITableRepository <TransactionHistory> >();
            TransactionHistoryService transactionService = new TransactionHistoryService(transactionTableRepository);

            transactionTableRepository.ContainsByPK(1).Returns(false);

            // Act
            var transaction = transactionService.GetTransactionByID(1);
        }
Exemplo n.º 2
0
        public void ShouldGetTransactionInfo()
        {
            // Arrange
            var transactionTableRepository = Substitute.For <ITableRepository <TransactionHistory> >();
            TransactionHistoryService transactionService = new TransactionHistoryService(transactionTableRepository);

            transactionTableRepository.ContainsByPK(1).Returns(true);


            // Act
            var transaction = transactionService.GetTransactionByID(1);

            // Assert
            transactionTableRepository.Received(1).FindByPK(1);
        }