public async Task CreatePaymentAsync_InsertsPaymentInDB() { //Setup var paymentRepository = new PaymentRepository(DatabaseContext); var paymentStatus = PaymentStatus.PaymentSucceeded; //Test await paymentRepository.CreatePaymentAsync(CancellationToken.None, CardNumber, Amount, Currency, paymentStatus, _bankTransactionUid, _createdDateUtc); await paymentRepository.SaveAsync(CancellationToken.None); //Verify Assert.Collection(DatabaseContext.Payments, payment => { Assert.Equal(ObfuscatedCardNumber, payment.ObfuscatedCardNumber); Assert.Equal(Amount, payment.Amount); Assert.Equal(Currency, payment.Currency); Assert.Equal(1, payment.Id); Assert.Equal(paymentStatus, payment.PaymentStatus); Assert.Equal(_createdDateUtc, payment.CreatedDateUtc); Assert.Equal(_bankTransactionUid, payment.BankTransactionUid); Assert.NotEqual(default(Guid), payment.Uid); }); }