예제 #1
0
        string Test7(string s)
        {
            Contract.Ensures(Contract.Result <string>() != null, "test");
            MyContract.MyAssume(s, s != null, "hello");

            return(s);
        }
예제 #2
0
        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");
        }
예제 #3
0
        void Test5(string s)
        {
            Contract.Requires(s != null, "yup");

            MyContract.MyAssert("hello", s != null, "test");
        }