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 SimpeDeHydrate_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); var owner = countyRepository.GetById(id); Assert.IsNotNull(owner); Assert.AreEqual(owner.Id, county.Id); }