void CheckLoggedMessages (MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger, string [] messages, string prefix) { try { for (int i = 0; i < messages.Length; i++) { logger.CheckLoggedMessageHead (messages [i], String.Format ("{0} #{1}", prefix, i)); } } catch { logger.DumpMessages (); throw; } Assert.AreEqual (0, logger.NormalMessageCount, "Number of remaining messages"); }
void CheckEventCounts (MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger, int project, int target, int task) { try { Assert.AreEqual (project, logger.ProjectStarted, "#project started events"); Assert.AreEqual (project, logger.ProjectFinished, "#project finished events"); Assert.AreEqual (target, logger.TargetStarted, "#target started events"); Assert.AreEqual (target, logger.TargetFinished, "#target finished events"); Assert.AreEqual (task, logger.TaskStarted, "#task started events"); Assert.AreEqual (task, logger.TaskFinished, "#task finished events"); Assert.AreEqual (1, logger.BuildStarted, "#build started events"); Assert.AreEqual (1, logger.BuildFinished, "#build finished events"); } catch (AssertionException) { logger.DumpMessages (); throw; } }