Exemple #1
0
            public void GetStateProvinceByCountryWithInvalidCountryExpectExpceptionThrown()
            {
                const int countryId = 0;
                var stateProvinceDao = MockRepository.GenerateStub<IStateProvinceDao>();
                var guestManager = new GuestManager() { StateProvinceDao = stateProvinceDao };
               
                guestManager.GetStateProvinceByCountry(countryId);

            }
Exemple #2
0
            public void GetStateProvinceByCountryExpectSuccess()
            {
                const int countryId = 1;
                var country = new Country() {Id = countryId};
                var stateProvinceDao = MockRepository.GenerateStub<IStateProvinceDao>();
                var guestManager = new GuestManager(){StateProvinceDao = stateProvinceDao};
                stateProvinceDao.Expect(x => x.GetAll()).Return(new List<StateProvince>() { new StateProvince(){Country = country}});
                
                var results = guestManager.GetStateProvinceByCountry(countryId);

                Assert.IsNotNull(results);
                Assert.IsTrue(results.Count() == 1);

            }