im trying to load a CSV file using Microsoft Visual Studio 2013. The code:
[TestMethod]
[DeploymentItem("data.csv")]
[DataSource("Microsoft.VisualStudio.TestTools.DataSource.CSV", "|DataDirectory|\\data.csv", "data#csv", DataAccessMethod.Sequential)]
public void Teste_Arquivo_EXEC()
{
// DETAIL
var row = TestContext.DataRow;
var detail = new EXECDetail();
detail.codigoVara = Int32.Parse(row["codigoVara"].ToString());
....
}
But, when i run the test, it gives me a System.ArgumentException: The column "codigoVara" does not belong to table. Here is the CSV file (its is copying from source to output dir):
codigoVara,codigoComarca,numeroProcesso,numeroAlvara,tipoPessoa,sequencialMovimento,tipoCredito,codigoAgencia,codigoBanco,contaCorrente,valor,nomeParte,cpfCnpj,idDeposito,sequencialRegistro
3001,1,1235520148140300,14013001005,F,1,15,3372,1,242020,150.42,LEANDRO HERNANDEZ ALMEIDA,84887532253,1,1
I tried with " symbol, like "codigoVara", but without success. I also noted an interesting thing: when i access the column through the index, it works!!!
detail.codigoVara = Int32.Parse(row[0].ToString());
Thanks in advance for any help =)