public async Task DeleteByIdAsync_ShouldReturnCorrectResult() { MapperInitializer.InitializeMapper(); var context = ApplicationDbContextInMemoryFactory.InitializeContext(); var countriesRepository = new EfDeletableEntityRepository <Country>(context); var countriesService = new CountriesService(countriesRepository); var seeder = new DbContextTestsSeeder(); await seeder.SeedCountriesAsync(context); var countryId = await countriesRepository.All() .Where(c => c.Name == "Bulgaria") .Select(c => c.Id) .FirstOrDefaultAsync(); var result = await countriesService.DeleteByIdAsync(countryId); Assert.True(result > 0, ErrorMessage); }