public void Dado_UmaLinhaComNoveInformacoes_Quando_RealizarLeituraDaLinhaEsperandoDezInformacoes_Entao_UmaExcecaoDeLinhaComDadosIncompletosDeveSerLancada(string linha) { //Arrange var leitor = new Leitores.LeitorTxtDadosCampeonato(_mapper); var campeonato = new Campeonato(2015); //Assert Assert.Throws <DadosIncompletosException>(() => { //Act LineDatailViewModel resultado = leitor.InterpretarDetalhesCampeonato(linha); }); }
public void Dado_UmArquivoTextoComFormatoEsperado_QuandoRealizarALeituraDoArquivo_Entao_UmObjetoNaoNuloRepresentandoACampeonatoDeveSerRetornado(string path) { //Arrange var leitor = new Leitores.LeitorTxtDadosCampeonato(_mapper); using (var stream = new FileStream(path, FileMode.Open)) { //Act var campeonato = leitor.InterpretarDadosCampeonato(stream); //Assert Assert.IsType <Campeonato>(campeonato); Assert.NotNull(campeonato); } }
public void Dado_ValoresEspecificosDePontosPorCampeonato_QuandoRealizarALeituraDoArquivo_Entao_ASomaDosPontosDeveSerIgualAoEsperado(string path, int somaPontos) { //Arrange var leitor = new Leitores.LeitorTxtDadosCampeonato(_mapper); using (var stream = new FileStream(path, FileMode.Open)) { //Act var campeonato = leitor.InterpretarDadosCampeonato(stream); //Assert Assert.IsType <Campeonato>(campeonato); Assert.Equal(somaPontos, campeonato.DetalhesCampeonato.Sum(p => p.Pontos)); Assert.NotNull(campeonato); } }