public Object[] LoadTestData(string fileName, string sheetName, string testCaseId, string[] columnNames)
{
log4net.Config.XmlConfigurator.Configure();
log4net.ThreadContext.Properties["myContext"] = "Logging from ExcelReader class";
Object[] objectArray = null;
try
{
testDataSet = new DataSet();
InitializeWorkbook(fileName);
XlsxToTableData(testCaseId, sheetName, columnNames);
objectArray = DisplayData(testCaseId, testDataSet.Tables[0]);
}
catch(NullReferenceException e)
{
string errorMessage = string.Concat("You Have Either Specified wrong Sheet name"
, "or the specified sheet name does not have data for the specified columns");
string methodName = System.Reflection.MethodBase.GetCurrentMethod().Name;
throw new ResourceException(methodName,errorMessage,e);
}
return objectArray;
}