public MainWindow() { InitializeComponent(); _leitorCSV = new LeitorCSV(); _leitorJSON = new LeitorJSON(); _seloCtrl = new SeloController(@"https://cidadao.portalseloam.com.br/portal-selo/selos/consulta"); }
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(); } }
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(); } }
public void Deve_Ler_Dois_Selos() { //Arranje leitor = new LeitorJSON(); //Act var selo = leitor.LerSelo(_json); //Assert Assert.Equal(_jsonDynamic.selo.codSelo, selo.Codigo); }
public SeloAPI(string apiUrl) { _apiURL = apiUrl; _httpClient = new HttpClient(); _leitorJSON = new LeitorJSON(); }