本文整理匯總了C#中MonoTests.Microsoft.Build.Tasks.TestMessageLogger.CheckHead方法的典型用法代碼示例。如果您正苦於以下問題:C# TestMessageLogger.CheckHead方法的具體用法?C# TestMessageLogger.CheckHead怎麽用?C# TestMessageLogger.CheckHead使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MonoTests.Microsoft.Build.Tasks.TestMessageLogger
的用法示例。
在下文中一共展示了TestMessageLogger.CheckHead方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: TestExecution
public void TestExecution ()
{
string documentString = @"
<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<Target Name='1'>
<Message Text='Text' Importance='Low'/>
<Message Text='Text' Importance='Normal'/>
<Message Text='Text' Importance='High'/>
<Message Text='Text' Importance='low'/>
<Message Text='Text' Importance='normal'/>
<Message Text='Text' Importance='high'/>
<Message Text='Text' />
<Message Text='Text' Importance='weird_importance'/>
</Target>
</Project>
";
engine = new Engine (Consts.BinPath);
testLogger = new TestMessageLogger ();
engine.RegisterLogger (testLogger);
project = engine.CreateNewProject ();
project.LoadXml (documentString);
project.Build ("1");
Assert.AreEqual (0, testLogger.CheckHead ("Text", MessageImportance.Low), "A1");
Assert.AreEqual (0, testLogger.CheckHead ("Text", MessageImportance.Normal), "A2");
Assert.AreEqual (0, testLogger.CheckHead ("Text", MessageImportance.High), "A3");
Assert.AreEqual (0, testLogger.CheckHead ("Text", MessageImportance.Low), "A4");
Assert.AreEqual (0, testLogger.CheckHead ("Text", MessageImportance.Normal), "A5");
Assert.AreEqual (0, testLogger.CheckHead ("Text", MessageImportance.High), "A6");
Assert.AreEqual (0, testLogger.CheckHead ("Text", MessageImportance.Normal), "A7");
Assert.AreEqual (1, testLogger.CheckHead ("Text", MessageImportance.Normal), "A8");
}