Is there any specific way to create a log file for my functions. All these functions are as testcases. I am using the below code to add the data.
string pathfile = @"data source location";
XLWorkbook workbook = new XLWorkbook(pathfile);
IXLWorksheet worksheet = workbook.Worksheet("Common");
worksheet.Cell("A2").Value = "1";
worksheet.Cell("B2").Value = "Test Case # 1";
worksheet.Cell("C2").Value = "1/29/2016 6:18:56 PM";
worksheet.Cell("D2").Value = "1/29/2016 6:19:56 PM";
worksheet.Cell("E2").Value = "1 minute";
workbook.Save();
Now I have to specify this every time in my every function. Is there any other better and good way to create excel log file?
Example of Excel Log File
+------+-------------------+-------------------------+---------------------------+---------------+
| ID | Testcases No. | Start Time | End Time | Total Time |
+------+-------------------+-------------------------+---------------------------+---------------+
| 1 | Test Case # 1 | 1/29/2016 6:18:56 PM | 1/29/2016 6:19:56 PM | 1 minute |
+------+-------------------+-------------------------+---------------------------+---------------+
| 2 | Test Case # 2 | 1/29/2016 6:20:50 PM | 1/29/2016 6:25:50 PM | 5 minutes |
+------+-------------------+-------------------------+---------------------------+---------------+
Program uses:
Selenium
Unit test class
Nunit to run my application