public void TestWeakerPrecondition() { // Code contracts does not support preconditions in derived types, // so this test will fail with precondition violation and // static checker warns us about it! var d = new Derived(); d.Foo(""); }
public void TestStrongerPostcondition() { var d = new Derived(); var r = d.Foo("42"); Assert.IsInstanceOf<string>(r); }