string Test7(string s) { Contract.Ensures(Contract.Result <string>() != null, "test"); MyContract.MyAssume(s, s != null, "hello"); return(s); }
static void Main(string[] args) { FooBar fooBar = new FooBar(); MyContract contract = fooBar.GetImplementation <MyContract>(); contract.PrintThis += (sender, s) => Console.WriteLine($"Print this: {s}"); contract.PrintText("Peeter"); }
void Test5(string s) { Contract.Requires(s != null, "yup"); MyContract.MyAssert("hello", s != null, "test"); }