public async void GetAllPaymentMethods_ShouldReturnAllPaymentMethodsFromDatabase() { var options = new DbContextOptionsBuilder <TechAndToolsDbContext>() .UseInMemoryDatabase(databaseName: "GetAllPaymentMethods_ShouldReturnAllPaymentMethods") .Options; var context = new TechAndToolsDbContext(options); await SeedData(context); IPaymentMethodService paymentMethodService = new PaymentMethodService(context); var expectedResult = await context.PaymentMethods.ToListAsync(); var actualResult = await paymentMethodService.GetAllPaymentMethods().ToListAsync(); Assert.Equal(expectedResult.Count, actualResult.Count); }