Exemplo n.º 1
0
        public ChurchRepositoryTests()
        {
            var connection = DbConnectionFactory.CreateTransient();
            var context    = new ChurchDb(connection);

            context.DefaultCountries();
            context.DefaultCities();
            context.DefaultChurches();
            _repository = new ChurchRepository(context);
        }
Exemplo n.º 2
0
        public void GetByCountryShouldReturnAListOfTheCitiesThatBelongsToTheGivenCountry()
        {
            const int countryId = 1;

            _context.DefaultCountries();
            _context.DefaultCities();
            var cities = Repository.GetByCountry(countryId).ToList();

            cities.Any().ShouldBeTrue();
            cities.Any(c => c.CountryId != countryId).ShouldBeFalse();
        }