public async Task GetByTransferId_ShouldReturnCorrectresult(int transferId, string driverId) { MapperInitializer.InitializeMapper(); var context = ApplicationDbContextInMemoryFactory.InitializeContext(); var driversRatingRepository = new EfDeletableEntityRepository <DriverRating>(context); var driversRatingsService = new DriversRatingsService(driversRatingRepository); var seeder = new DbContextTestsSeeder(); await seeder.SeedDriversRatings(context); var result = await driversRatingsService.GetByTransferId(transferId); Assert.True(result.DriverId == driverId, ErrorMessage); }
public async Task DeleteAllByDriverIdAsync_ShouldReturnCorrectResult() { MapperInitializer.InitializeMapper(); var context = ApplicationDbContextInMemoryFactory.InitializeContext(); var driversRatingRepository = new EfDeletableEntityRepository <DriverRating>(context); var driversRatingsService = new DriversRatingsService(driversRatingRepository); var seeder = new DbContextTestsSeeder(); await seeder.SeedDriversRatings(context); var result = await driversRatingsService.DeleteAllByDriverIdAsync("abc"); Assert.True(result == 3, ErrorMessage); }