Example #1
0
        public ChurchRepositoryTests()
        {
            var connection = DbConnectionFactory.CreateTransient();
            var context    = new ChurchDb(connection);

            context.DefaultCountries();
            context.DefaultCities();
            context.DefaultChurches();
            _repository = new ChurchRepository(context);
        }
        public CountryRepositoryTests()
        {
            //Effort.Provider.EffortProviderConfiguration.RegisterProvider();
            var connection = Effort.DbConnectionFactory.CreateTransient();
            var context    = new ChurchDb(connection);

            //For the these tests we will add this countries
            context.DefaultCountries();
            _repository = new CountryRepository(context);
        }
        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();
        }