예제 #1
0
        public async Task Should_Return_Error_When_Null_Request_For_PaymentByCash()
        {
            //Arrange
            var automatFacade = new AutomatFacade(new FakeProductRepository(), new FakeCampaingRepository(), new FakeTransactionRepository());

            //Act
            var result = await automatFacade.PaymentByCash(null);

            //Assert
            Assert.Equal(1, result.Code);
        }
예제 #2
0
        public async Task Should_Return_Error_When_TransactionAmount_Bigger_Than_CachAmount()
        {
            //Arrange
            var automatFacade = new AutomatFacade(new FakeProductRepository(), new FakeCampaingRepository(), new FakeTransactionRepository());

            //Act
            PaymentByCashEntity paymentByCashEntity = new PaymentByCashEntity();

            paymentByCashEntity.CashAmount    = 1;
            paymentByCashEntity.Id            = 1;
            paymentByCashEntity.TransactionId = 1;
            var result = await automatFacade.PaymentByCash(paymentByCashEntity);

            //Assert
            Assert.Equal(1, result.Code);
        }