Index: Core/Common/test/Core.Common.TestUtils/TestHelper.cs =================================================================== diff -u -r6a3a7c7e3442a1c99598c8f0fe7bd95062bc8845 -r280d9fcb4562ac74c2a932bb59765d9a277380e9 --- Core/Common/test/Core.Common.TestUtils/TestHelper.cs (.../TestHelper.cs) (revision 6a3a7c7e3442a1c99598c8f0fe7bd95062bc8845) +++ Core/Common/test/Core.Common.TestUtils/TestHelper.cs (.../TestHelper.cs) (revision 280d9fcb4562ac74c2a932bb59765d9a277380e9) @@ -263,66 +263,6 @@ } /// - /// Method used to check if a specific message is not in the log. - /// This function allowed checking log messages being generated like - /// without having to rerun the action for every single message. - /// - /// The action to be performed that should not generate - /// The log message that should not occur in the log - /// Optional: assert that log has this number of messages. - /// - [Obsolete("Please keep in mind that asserting unwanted messages are 'very easy to pass' asserts and can pass by a random change of 1 character.")] - public static void AssertLogMessageIsNotGenerated(Action action, string unwantedMessage, int? expectedLogMessageCount = null) - { - AssertLogMessagesAreNotGenerated(action, new[] - { - unwantedMessage - }, expectedLogMessageCount); - } - - /// - /// Method used to check if a collection of messages have not occurred in the log. - /// This function allowed checking log messages being generated like - /// without having to rerun the action for every single message. Fails the test when any of checks fail. - /// - /// The action to be performed that should not generate any of the messages in - /// The log messages that should not occur in the log - /// Optional: assert that log has this number of messages. - /// - [Obsolete("Please keep in mind that asserting unwanted messages are 'very easy to pass' asserts and can pass by a random change of 1 character.")] - public static void AssertLogMessagesAreNotGenerated(Action action, IEnumerable unwantedMessages, int? expectedLogMessageCount = null) - { - var renderedMessages = GetAllRenderedMessages(action); - - AssertUnwantedMessagesNotInRenderedMessages(unwantedMessages, renderedMessages); - if (expectedLogMessageCount != null) - { - Assert.AreEqual((int) expectedLogMessageCount, renderedMessages.Count()); - } - } - - /// - /// Checks if all expected messages occur in the log, - /// while none of the unwanted messages should occur in the log. - /// - /// Action to be performed while recording the log - /// Collection of expected messages that should be in the log - /// Collection of messages of which none should be in the log - /// Optional: assert that log has this number of messages. - [Obsolete("Please keep in mind that asserting unwanted messages are 'very easy to pass' asserts and can pass by a random change of 1 character.")] - public static void AssertLogExpectedAndUnwantedMessages(Action action, IEnumerable expectedMessages, IEnumerable unwantedMessages, int? expectedLogMessageCount = null) - { - var renderedMessages = GetAllRenderedMessages(action); - - AssertUnwantedMessagesNotInRenderedMessages(unwantedMessages, renderedMessages); - AssertExpectedMessagesInRenderedMessages(expectedMessages, renderedMessages); - if (expectedLogMessageCount != null) - { - Assert.AreEqual((int) expectedLogMessageCount, renderedMessages.Count()); - } - } - - /// /// Checks the number of messages in the log. /// /// Action to be performed while recording the log Index: Core/Common/test/Core.Common.Utils.Tests/TestHelperTests.cs =================================================================== diff -u -r293be5aa0c9cfb58fea075f0ce6943fdfb310406 -r280d9fcb4562ac74c2a932bb59765d9a277380e9 --- Core/Common/test/Core.Common.Utils.Tests/TestHelperTests.cs (.../TestHelperTests.cs) (revision 293be5aa0c9cfb58fea075f0ce6943fdfb310406) +++ Core/Common/test/Core.Common.Utils.Tests/TestHelperTests.cs (.../TestHelperTests.cs) (revision 280d9fcb4562ac74c2a932bb59765d9a277380e9) @@ -113,41 +113,6 @@ } [Test] - public void TestAssertLogExpectedAndUnwantedMessages() - { - TestHelper.AssertLogExpectedAndUnwantedMessages(() => log.Error("Test 1"), - new[] - { - "Test 1" - }, - new[] - { - "Test1", - "Test 2" - }); - TestHelper.AssertLogExpectedAndUnwantedMessages(() => log.Warn("Test 1"), - new[] - { - "Test 1" - }, - new[] - { - "Test1", - "Test 2" - }); - TestHelper.AssertLogExpectedAndUnwantedMessages(() => log.Info("Test 1"), - new[] - { - "Test 1" - }, - new[] - { - "Test1", - "Test 2" - }); - } - - [Test] public void TestAssertLogMessagesCount() { TestHelper.AssertLogMessagesCount(() => log.Error("test 1"), 1);