public void TestThatCustomizedMessageOccursInToString() { var tc = TestHelper.FindTestCase<IntegerCalculatorTest>(t => t.TestAddBasic()); var rule = new SomeRule(); var violation = new Violation(rule, tc, "a message"); StringAssert.EndsWith(": a message", violation.ToString()); }
public void TestThatToStringWithoutDebugSymbolsIncludesTypeAndMethod() { var tm = typeof(IntegerCalculatorTest).FindMethod("TestAddBasic()"); var rule = new SomeRule(); var violation = new Violation(rule, new TestCase(tm, null)); const string expected = "TestNess.Target.IntegerCalculatorTest(TestAddBasic()): violation of \"some rule\""; Assert.AreEqual(expected, violation.ToString()); }