public async Task DeleteCityAsync_Should_Throw_ObjectNotFoundException() { var city = new City() { CityId = 1, Name = "Stockholm" }; var mockedRepository = new Mock <ICitiesRepository>(); var mapperConfiguration = new MapperConfiguration(cfg => { cfg.AddProfile(new DomainProfile()); }); var mockedMapper = mapperConfiguration.CreateMapper(); var cityService = new CitiesService(mockedRepository.Object, mockedMapper); await Assert.ThrowsAsync <ObjectNotFoundException>(() => cityService.DeleteCityAsync(2)); }