public void CanGetFormattedEntryWithMessageAndExceptionAndExtraInformation() { EventLogEntryFormatter formatter = new EventLogEntryFormatter(applicationName, blockName); Exception ex = null; string[] extraInformation = new string[] { extraInformation1, extraInformation2 }; try { throw new Exception(exceptionMessage); } catch (Exception e) { ex = e; } string entryText = formatter.GetEntryText(errorMessage, ex, extraInformation); Assert.IsNotNull(entryText); Assert.IsTrue(entryText.IndexOf(errorMessage) > 0); Assert.IsTrue(entryText.IndexOf(applicationName) > 0); Assert.IsTrue(entryText.IndexOf(blockName) > 0); Assert.IsTrue(entryText.IndexOf(exceptionMessage) > 0); Assert.IsTrue(entryText.IndexOf(extraInformation1) > 0); Assert.IsTrue(entryText.IndexOf(extraInformation2) > 0); }
public void CanGetFormattedEntryWithMessage() { EventLogEntryFormatter formatter = new EventLogEntryFormatter(applicationName, blockName); string entryText = formatter.GetEntryText(errorMessage); Assert.IsNotNull(entryText); Assert.IsTrue(entryText.IndexOf(applicationName) > 0); Assert.IsTrue(entryText.IndexOf(blockName) > 0); Assert.IsTrue(entryText.IndexOf(errorMessage) > 0); }
public void CanGetFormattedEntryWithMessageAndExtraInformation() { EventLogEntryFormatter formatter = new EventLogEntryFormatter(applicationName, blockName); string[] extraInformation = new string[] { extraInformation1, extraInformation2 }; string entryText = formatter.GetEntryText(errorMessage, extraInformation); Assert.IsNotNull(entryText); Assert.IsTrue(entryText.IndexOf(applicationName) > 0); Assert.IsTrue(entryText.IndexOf(blockName) > 0); Assert.IsTrue(entryText.IndexOf(errorMessage) > 0); Assert.IsTrue(entryText.IndexOf(extraInformation1) > 0); Assert.IsTrue(entryText.IndexOf(extraInformation2) > 0); }