public void FluentPorCepNaoDeveLancarExceptionAsync() => Assert.DoesNotThrowAsync(async() => { var cep = Cep.Of("01001000"); await ViaCepFluent.RequisicaoPorCep .ComOsDados(cep) .RetorneComoEnderecoAsync(endereco => Assert.True(cep.Formatado() == endereco.Cep)); await ViaCepFluent.RequisicaoPorCep .ComOsDados(cep) .RetorneComoJsonAsync(json => Assert.True(json.Contains(cep.Formatado()))); await ViaCepFluent.RequisicaoPorCep .ComOsDados(cep) .RetorneComoPipedAsync(piped => Assert.True(piped.Contains("cep:01001-000|"))); await ViaCepFluent.RequisicaoPorCep .ComOsDados(cep) .RetorneComoQuertyAsync(querty => Assert.True(querty.Contains("cep=01001-000"))); await ViaCepFluent.RequisicaoPorCep .ComOsDados(cep) .RetorneComoXmlAsync(xml => Assert.True(xml.FirstNode.ToString().Contains("<cep>01001-000</cep>"))); });
public void CepDeveEstarFormatado() => Assert.AreEqual(Cep.Of("01001000").Formatado(), "01001-000");