예제 #1
0
 public RegionIntegrationHandler(
     IRegionIbgeRepository regionIbgeRepository,
     IHandler <CreateRegionCommand> handler)
 {
     this.regionIbgeRepository = regionIbgeRepository;
     this.handler = handler;
 }
예제 #2
0
 public RegionDiffServices(
     IRegionIbgeRepository ibgeRepository,
     IRegionRepository repository)
 {
     this._ibgeRepository = ibgeRepository;
     this._repository     = repository;
 }
예제 #3
0
        public RegionIntegrationTests()
        {
            fakeRepository = new RegionRepository(new FakeContext());
            handler        = new RegionHandler(fakeRepository);
            _http          = new HttpClient();

            invalidRegionIbgeRepository = new RegionIbgeRepository(null);
            invalidIntegrationHandler   = new RegionIntegrationHandler(invalidRegionIbgeRepository, handler);

            validRegionIbgeRepository = new RegionIbgeRepository(_http);
            validIntegrationHandler   = new RegionIntegrationHandler(validRegionIbgeRepository, handler);
        }
예제 #4
0
        public RegionDiffServicesTests()
        {
            httpClient           = new HttpClient();
            regionIbgeRepository = new RegionIbgeRepository(httpClient);
            context          = new FakeContext();
            regionRepository = new RegionRepository(context);
            context.Region.RemoveRange(regionRepository.Get());
            local = new List <Region>()
            {
                new Region(1, "N", "Norte"),
                new Region(2, "NE", "Nordeste"),
                new Region(3, "SE", "Sudeste"),
                new Region(4, "S", "Sul"),
                new Region(5, "CO", "Centro-Oeste")
            };
            local.ForEach(x => regionRepository.Create(x));


            regionDiffServices = new RegionDiffServices(regionIbgeRepository, regionRepository);
        }