What I'm gonna cover
[Dbc, Invariant("Prop1 >= 1")] public class MyTestClass { public MyTestClass() { Prop1 = 10; } #region property Prop1 int prop1 = 0; [Requires("value != 1561")] public int Prop1 { get { return prop1; } set { prop1 = value; } } #endregion [Requires("arg1 > 10")] [Requires("arg2 < 100")] [Ensures("$after(Prop1) == $before(Prop1) + 1")] public void TestMethod(int arg1, int arg2, string arg3) { Prop1 = Prop1 + 1; System.Diagnostics.Debug.WriteLine( "MyTestClass.TestMethod.Prop1 == " + prop1.ToString()); } }During the rest of the project I'll show you how I expand this system to work with Aspect Oriented Programming, and Static and Dynamic Proxies. I'll also explore the best ways of implementing the control logic under the hood. Till then, I guess we're stuck with Asserts or ifs at the beginning of methods.
Powered for Blogger by Blogger templates