public void ImportVariablesFileSuccesses()
{
var man = GetManager();
man.WorkingPath = Path.Combine(man.WorkingPath, "ColumnFiles");
man.CheckColumnMappingsFile();
/************************************************************************************/
string Valid100Lines = Path.Combine(man.WorkingPath, "Valid100Lines.txt");
string ValidNoNames = Path.Combine(man.WorkingPath, "ValidNoNames.txt");
/************************************************************************************/
using (var conn = man.DbClient.GetConnection())
{
if (!DataClient.HasTable(conn, man.DbClient, "columnMappings"))
{
if (!man.CreateColumnMappingsTable(conn))
{
Assert.Fail("Could not import sequence files");
}
}
/* Successes */
DataTable dt = null;
//105 should really be 100, but there are duplicate rows in columnMappings
//See #19869
//If/when that bug gets fixed, 105 should be changed to 100 and this comment deleted
Assert.IsTrue(File.Exists(Valid100Lines), "Could not find test file " + Valid100Lines);
man.DesiredVariablesFilename = Valid100Lines;
dt = man.GetRequestedVariables(conn);
Assert.AreEqual(105, dt.Rows.Count,
"Unexpected number of rows returned for file " + Valid100Lines);
Assert.IsTrue(File.Exists(ValidNoNames), "Could not find test file " + ValidNoNames);
man.DesiredVariablesFilename = ValidNoNames;
dt = man.GetRequestedVariables(conn);
Assert.AreEqual(105, dt.Rows.Count,
"Unexpected number of rows returned for file " + ValidNoNames);
}
}