I have custom event logger, and I want to test it.
[Test]
public void AddLogWithExceptionAndEventLogEntryTypeTest()
{
const string loggerName = "mockLoggerName";
var logger = new MyLogger(loggerName);
System.Diagnostics.EventLog log = new System.Diagnostics.EventLog("System");
string logValue = Guid.NewGuid().ToString();
logger.AddEntry(new Exception(logValue),EventLogEntryType.Error );
foreach (
EventLogEntry entry in log.Entries)
{
if (entry.Message.ToUpper().Contains(logValue))
{
//what can is do ?
}
}
}
What assert to use to give information, that entry was added ?