public void LogToTarget_WriteSecurityEventToJSONLog_ReadTextSucccessful(string expectedMessage, EventName eventName)
        {
            // Arrange
            ILogTarget logTarget = new JsonLogTarget();

            // Act
            logTarget.LogToTarget(expectedMessage, eventName);

            //Assert
            string actualMessage = LogTargetHelper.ReadTestLog(eventName, TargetType.Json);

            StringAssert.Contains(actualMessage, expectedMessage.ToString());
        }
Example #2
0
        public void LogToTarget_WriteNetworkEventToTextLog_ReadTextSucccessful(string expectedMessage, EventName eventName)
        {
            // Arrange
            ILogTarget logTarget = new TextLogTarget();

            // Act
            logTarget.LogToTarget(expectedMessage, eventName);

            //Assert
            string actualMessage = LogTargetHelper.ReadTestLog(eventName, TargetType.Text);

            Assert.IsTrue(actualMessage == expectedMessage.ToString());
        }