public MainWindow()
 {
     InitializeComponent();
     _leitorCSV  = new LeitorCSV();
     _leitorJSON = new LeitorJSON();
     _seloCtrl   = new SeloController(@"https://cidadao.portalseloam.com.br/portal-selo/selos/consulta");
 }
Exemplo n.º 2
0
        public static void CriarMaterias()
        {
            using (var contexto = new UniversidadeContext())
            {
                LeitorJSON <Materia> .LerJson("Materias.json").ForEach(m => contexto.Materia.Add(m));

                contexto.SaveChanges();
            }
        }
        public static void CriarProfessores()
        {
            using (var contexto = new UniversidadeContext())
            {
                LeitorJSON <Professor> .LerJson("Professores.json").ForEach(p => contexto.Professor.Add(p));

                contexto.SaveChanges();
            }
        }
Exemplo n.º 4
0
 public SeloControllerTests()
 {
     _seloController = new SeloController(_apiUrl);
     _leitorJSON     = new LeitorJSON();
     _caminhoJson    = Path.Combine(Environment.CurrentDirectory, "Controllers", "Resources", "selo-certidao.json");
     _json           = File.ReadAllText(_caminhoJson);
     _jsonDynamic    = DeserializarArquivoJson();
     _apiUrl         = @"https://cidadao.portalseloam.com.br/portal-selo/selos/consulta";
 }
        public static void CriarRelacionamentoInicial()
        {
            using (var contexto = new UniversidadeContext())
            {
                LeitorJSON <ProfessorMateria> .LerJson("ProfessorMaterias.json").ForEach(a => contexto.ProfessorMateria.Add(a));

                contexto.SaveChanges();
            }
        }
Exemplo n.º 6
0
        public void Deve_Ler_Dois_Selos()
        {
            //Arranje
            leitor = new LeitorJSON();

            //Act
            var selo = leitor.LerSelo(_json);

            //Assert
            Assert.Equal(_jsonDynamic.selo.codSelo, selo.Codigo);
        }
Exemplo n.º 7
0
 public SeloAPI(string apiUrl)
 {
     _apiURL     = apiUrl;
     _httpClient = new HttpClient();
     _leitorJSON = new LeitorJSON();
 }