Beispiel #1
0
        public void TestLogMessageEventNotSerializableMP()
        {
            MyCustomMessageEventNotSerializable e = new MyCustomMessageEventNotSerializable("Message");

            _mockHost.BuildParameters.MaxNodeCount = 4;
            _taskHost.LogMessageEvent(e);
            Assert.True(_taskHost.IsRunningMultipleNodes);

            // Make sure our custom logger received the actual custom event and not some fake.
            Assert.True(_customLogger.LastWarning is BuildWarningEventArgs); // "Expected Warning Event"
            Assert.Equal(1, _customLogger.NumberOfWarning);                  // "Expected there to be only one warning"

            string message = ResourceUtilities.FormatResourceString("ExpectedEventToBeSerializable", e.GetType().Name);

            Assert.True(_customLogger.LastWarning.Message.Contains(message)); // "Expected line to contain NotSerializable message but it did not"
        }
Beispiel #2
0
        public void TestLogMessageEventNotSerializableMP()
        {
            MyCustomMessageEventNotSerializable e = new MyCustomMessageEventNotSerializable("Message");

            _mockHost.BuildParameters.MaxNodeCount = 4;
            _taskHost.LogMessageEvent(e);
            Assert.IsTrue(_taskHost.IsRunningMultipleNodes);

            // Make sure our custom logger received the actual custom event and not some fake.
            Assert.IsTrue(_customLogger.LastWarning is BuildWarningEventArgs, "Expected Warning Event");
            Assert.IsTrue(_customLogger.NumberOfWarning == 1, "Expected there to be only one warning");

            string message = ResourceUtilities.FormatResourceString("ExpectedEventToBeSerializable", e.GetType().Name);
            Assert.IsTrue(_customLogger.LastWarning.Message.Contains(message), "Expected line to contain NotSerializable message but it did not");
        }