@@ -103,6 +103,37 @@ public void ForcedFailureHasMessage()
103103 Assert . IsTrue ( forcedFailure . ErrorMessage . Contains ( "This message should be in the failure report." ) ) ;
104104 }
105105
106+ [ TestMethod ]
107+ public void WarningAndInfoMessage ( )
108+ {
109+ // Set up a fake testing context.
110+ var framework = new MockFrameworkHandle ( ) ;
111+
112+ // Execute all tests.
113+ TestExecutor executor = new TestExecutor ( ) ;
114+ executor . RunTests ( Common . ReferenceExeList , new MockRunContext ( ) , framework ) ;
115+
116+ // Map the tests by name.
117+ Dictionary < string , TestResult > resultsByName = new Dictionary < string , TestResult > ( ) ;
118+ foreach ( var result in framework . Results )
119+ {
120+ resultsByName [ result . TestCase . FullyQualifiedName ] = result ;
121+ }
122+
123+ TestResult testResult = resultsByName [ "Warn" ] ;
124+ Assert . AreEqual ( TestOutcome . Failed , testResult . Outcome ) ;
125+ Assert . IsTrue ( testResult . ErrorMessage . Contains ( "#1 - CHECK(false) with expansion: (false)" ) ) ;
126+ Assert . AreEqual ( 1 , testResult . Messages . Count ) ;
127+ Assert . IsTrue ( testResult . Messages [ 0 ] . Text . Contains ( "WARN: This is a warning message" ) ) ;
128+
129+ testResult = resultsByName [ "Info" ] ;
130+ Assert . AreEqual ( TestOutcome . Failed , testResult . Outcome ) ;
131+ Assert . IsTrue ( testResult . ErrorMessage . Contains ( "#1 - CHECK(false) with expansion: (false)" ) ) ;
132+ Assert . AreEqual ( 1 , testResult . Messages . Count ) ;
133+ Assert . IsTrue ( testResult . Messages [ 0 ] . Text . Contains ( "INFO: This is a info message" ) ) ;
134+
135+ }
136+
106137 [ TestMethod ]
107138 public void BrokenXmlWithSingleTest ( )
108139 {
0 commit comments