Example #1
0
        public void TestLogWarningEventNotSerializableMP()
        {
            MyCustomBuildWarningEventArgsNotSerializable e = new MyCustomBuildWarningEventArgsNotSerializable("SubCategory");

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

            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"
        }
Example #2
0
        public void TestLogWarningEventNotSerializableMP()
        {
            MyCustomBuildWarningEventArgsNotSerializable e = new MyCustomBuildWarningEventArgsNotSerializable("SubCategory");

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

            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");
        }