public void Simple_Status_County() { IRegionRepository regionRepository = Substitute.For <IRegionRepository>(); var f = new Fixture(); var region = f.Create <Region>(); var county = CreateCounty(region.GetMasterDataRef()); regionRepository.GetById(Arg.Any <Guid>()).Returns(region); var countyRepository = new CountyRepository(ContextConnection(), regionRepository); countyRepository.Save(county); countyRepository.SetInactive(county); var inactive = countyRepository.GetById(county.Id); Assert.That(inactive.Status == EntityStatus.Inactive); countyRepository.SetActive(county); var active = countyRepository.GetById(county.Id); Assert.That(active.Status == EntityStatus.Active); countyRepository.SetAsDeleted(county); var deleted = countyRepository.GetById(county.Id); Assert.That(deleted.Status == EntityStatus.Deleted); }
public void SimpeHydrate_County() { IRegionRepository regionRepository = Substitute.For <IRegionRepository>(); var f = new Fixture(); var region = f.Create <Region>(); var county = CreateCounty(region.GetMasterDataRef()); regionRepository.GetById(Arg.Any <Guid>()).Returns(region); var countyRepository = new CountyRepository(ContextConnection(), regionRepository); var id = countyRepository.Save(county); Assert.IsNotNull(id); Assert.AreEqual(id, county.Id); }
public void SimpeDeHydrateAll_County() { IRegionRepository regionRepository = Substitute.For <IRegionRepository>(); var f = new Fixture(); var region = f.Create <Region>(); var county = CreateCounty(region.GetMasterDataRef()); regionRepository.GetById(Arg.Any <Guid>()).Returns(region); var countyRepository = new CountyRepository(ContextConnection(), regionRepository); countyRepository.Save(county); var owner = countyRepository.GetAll(); Assert.That(owner.Any()); }
// [TAG]Save Related Data static void AddSimpleCounty() { var city = new City { CityCode = 9, FullName = "Hà Giang", IsDelete = false, NameFormated = "Hà_Giang_9", }; var county = new County() { City = city, FullName = "County_1" + city.FullName, NameFormated = "County_1" + city.NameFormated, IsDelete = false, }; var countyRepo = new CountyRepository(); countyRepo.Add(new List <County> { county }); }
public static List <County> GetAllCounties() { return(CountyRepository.GetAllCounties()); }
static void InitialCountyData() { var countyRepository = new CountyRepository(); countyRepository.AddDataTemplate(); }
// [Todo] Lazy loading static void LazyLoading() { var countyRepo = new CountyRepository(); //countyRepo.LazyLoadingAddress(); }
// [TAG] Changing relationships static void ChangingRelationshipsCounty() { var countyRepo = new CountyRepository(); countyRepo.ChangeRelationship(); }