public static void Test5_Bugged(string name) { StringTest stringTest = new StringTest(); if (name == null) { stringTest.Msg = "Please pass a name on the query string or in the request body"; } else { stringTest.Msg = "Hello " + name; } Contract.Assert(!(stringTest.Msg == "Please pass a name on the query string or in the request body" || stringTest.Msg == "Hello " + name)); }
public static void Test4_NoBugs(bool b, string name) { StringTest stringTest = new StringTest(); if (b) { stringTest.Msg = "Please pass a name on the query string or in the request body"; } else { stringTest.Msg = "Hello " + name; } Contract.Assert(stringTest.Msg == "Please pass a name on the query string or in the request body" || stringTest.Msg == "Hello " + name); }