public async Task ProcessPaymentAsync_ForValidRequestHavingAmountLessThan20_CheapGatewayIsCalledAndReturnsProcessedStatusAsync() { //Arrange var model = GetPaymentRequestModel(9); _cheapPaymentGateway.ProcessPaymentAsync(Arg.Any <PaymentRequestModel>()) .Returns(Task.FromResult(PaymentStatus.Processed)); _unitOfWork.PaymentsRepository.When(x => x.AddAsync(Arg.Any <PaymentEntities.Entities.Payment>())).Do(x => { }); _unitOfWork.PaymentsRepository.When(x => x.UpdateAsync(Arg.Any <PaymentEntities.Entities.Payment>())).Do(x => { }); _unitOfWork.When(x => x.Complete()).Do(x => {}); //Act var actual = await _paymentBusiness.ProcessPaymentAsync(model); //Assert Assert.AreEqual(PaymentStatus.Processed, actual); _serviceAccessor.Received(1).Invoke(Arg.Any <string>()); await _cheapPaymentGateway.Received(1).ProcessPaymentAsync(Arg.Any <PaymentRequestModel>()); await _unitOfWork.PaymentsRepository.Received(1).AddAsync(Arg.Any <PaymentEntities.Entities.Payment>()); await _unitOfWork.PaymentsRepository.Received(1).UpdateAsync(Arg.Any <PaymentEntities.Entities.Payment>()); _unitOfWork.Received(1).Complete(); }