Hi
I want to mock the following when index is used together with sqlReader in the code below. How can I do this?
private static int ExtractAndConvertToInt(SqlDataReader reader, string indexName)
{
int outputValue = 0;
try
{
if (reader[indexName] != DBNull.Value)
{
outputValue = Convert.ToInt32(reader[indexName]);
}
}
catch (Exception exception)
{
Log.Warning("Failed to extract : " + indexName, exception);
}
return outputValue;
}