Ejemplo n.º 1
0
        public void CheckUserExists()
        {
            mockUnitOfWork.Setup(x => x.PdvHistoryRepository.GetPaymentsHistory(It.IsAny<DateTime>(), It.IsAny<DateTime>())).Returns(GetTestPdvHistories);

            var pdvServices = new PdvServices(mockUnitOfWork.Object);
            var histories = pdvServices.GetPdvHistories(It.IsAny<DateTime>(), It.IsAny<DateTime>());

            Assert.NotNull(histories);
            Assert.Collection(histories,
                              item => Assert.Equal(100, item.Amount),
                              item => Assert.Equal(300, item.Amount));
        }
Ejemplo n.º 2
0
        public void PayBill()
        {
            var amout = 100;
            var total = 90;

            mockUnitOfWork.Setup(x => x.PdvHistoryRepository.Insert(It.IsAny<PdvHistory>()));

            var pdvServices = new PdvServices(mockUnitOfWork.Object);
            var pdvResult = pdvServices.PayBill(amout, total);

            mockUnitOfWork.Verify(x => x.PdvHistoryRepository.Insert(It.IsAny<PdvHistory>()), Times.Exactly(2));
            Assert.NotNull(pdvResult);
            Assert.True(pdvResult.IsClosed);
            Assert.Equal(1, pdvResult.BankNotesToReturn[3]);
        }