1
I have a query and would like to know if the same returned data.
//classe aplicação-
private List<tb_cabecalho> TransformaReaderEmListaObjetos(SqlDataReader reader)
{
var retornando = new List<tb_cabecalho>();
while (reader.Read())
{
tb_cabecalho tabela = new tb_cabecalho()
{
campofixo = "H",
cnpjdoecomerce = "61549259000180",
dataincial = reader["DataInicial"] == DBNull.Value ? DateTime.MinValue : Convert.ToDateTime(reader["DataInicial"]),
datafinal = reader["DataFinal"] == DBNull.Value ? DateTime.MinValue : Convert.ToDateTime(reader["DataFinal"])
};
retornando.Add(tabela);
}
reader.Close();
return retornando;
}
/// <summary>
/// Aqui estou retornando os dados do cabecalho
/// </summary>
var tbuscar = new cabecalhoAplicacao();
var retorno = tbuscar.DadosDoCabecalho();
Do you want to test inside the Transform methodsby testing objects or want to test the return of it?
– Intruso
I want to check if the Transformeaderemlistaobjects is returning the data because if vim empty will generate an error
– Harry
The GOKU Ssjgod answer.
– Intruso