public void WriteTestFailed_ShouldOutputTestFailedAndFinishedMessage() { _subject = new TestMessageLogger("test1"); var message = "kaboom"; var details = "stack trace"; _subject.WriteTestFailed(message, details); var output = String.Format("##teamcity[testFailed name='test1' message='{0}' details='{1}']\r\n", message, details) + GenerateFinishedMessage(0); Assert.That(_textMessageWriter.ToString(), Is.EqualTo(output)); }