Exemple #1
0
        public void Simple_Status_Ward()
        {
            IConstituencyRepository constituencyRepository = Substitute.For <IConstituencyRepository>();
            var f            = new Fixture();
            var constituency = f.Create <Constituency>();
            var ward         = CreateWard(constituency.GetMasterDataRef());

            constituencyRepository.GetById(Arg.Any <Guid>()).Returns(constituency);
            var wardRepository = new WardRepository(ContextConnection(), constituencyRepository);

            wardRepository.Save(ward);
            wardRepository.SetInactive(ward);
            var inactive = wardRepository.GetById(ward.Id);

            Assert.That(inactive.Status == EntityStatus.Inactive);

            wardRepository.SetActive(ward);
            var active = wardRepository.GetById(ward.Id);

            Assert.That(active.Status == EntityStatus.Active);

            wardRepository.SetAsDeleted(ward);
            var deleted = wardRepository.GetById(ward.Id);

            Assert.That(deleted.Status == EntityStatus.Deleted);
        }
Exemple #2
0
        public void SimpeHydrate_Ward()
        {
            IConstituencyRepository constituencyRepository = Substitute.For <IConstituencyRepository>();
            var f            = new Fixture();
            var constituency = f.Create <Constituency>();
            var ward         = CreateWard(constituency.GetMasterDataRef());

            constituencyRepository.GetById(Arg.Any <Guid>()).Returns(constituency);
            var wardRepository = new WardRepository(ContextConnection(), constituencyRepository);
            var id             = wardRepository.Save(ward);

            Assert.IsNotNull(id);
            Assert.AreEqual(id, ward.Id);
        }
Exemple #3
0
        public void SimpeDeHydrateAll_Ward()
        {
            IConstituencyRepository constituencyRepository = Substitute.For <IConstituencyRepository>();
            var f            = new Fixture();
            var constituency = f.Create <Constituency>();
            var ward         = CreateWard(constituency.GetMasterDataRef());

            constituencyRepository.GetById(Arg.Any <Guid>()).Returns(constituency);
            var wardRepository = new WardRepository(ContextConnection(), constituencyRepository);

            wardRepository.Save(ward);
            var owner = wardRepository.GetAll();

            Assert.That(owner.Any());
        }
 public ConstituencyBusiness(IConstituencyRepository constituencyRepository)
 {
     this.constituencyRepository = constituencyRepository;
 }
Exemple #5
0
 public ConstituencyBusiness(IConstituencyRepository constituencyRepository)
 {
     constituencyRL = constituencyRepository;
 }
 public ConstituencyService()
 {
     _constituencyRepository = new ConstituencyRepository();
     _areaRepository         = new AreaRepository();
 }
Exemple #7
0
 public ConstituencyViewModelBuilder(IConstituencyRepository constituencyRepository, ICountyRepository countyRepository)
 {
     _constituencyRepository = constituencyRepository;
     _countyRepository       = countyRepository;
 }
Exemple #8
0
 public WardRepository(ContextConnection contextConnection, IConstituencyRepository constituencyRepository)
     : base(contextConnection)
 {
     _constituencyRepository = constituencyRepository;
 }