// ------------------------------------------------------------------

// Inv.cs: Represents OCL testing for Invariants

// ------------------------------------------------------------------

// Project: C# and OCL Compiler

// Module:  Testing

// Author:  Dave Arnold

// Version: 1.0

// ------------------------------------------------------------------

 

// ------------------------------------------------------------------

// Imports

// ------------------------------------------------------------------

using System;

using System.Collections;

// ------------------------------------------------------------------

 

// ------------------------------------------------------------------

// DaveArnold.OCLTesting Namespace

// ------------------------------------------------------------------

namespace DaveArnold.OCLTesting

{

       // A Class to test Invariants

       OCL

       [

              "context InvTests"

              "inv: age >= 18"

       ]

       class InvTests

       {

              private int age = 0;

             

              OCL

              [

                     "context InvTests::InvTests():"

                     "post: age = 18"

              ]

              public InvTests()

              {

                     age = 18;

              }

             

              OCL

              [

                     "context InvTests::~InvTests():"

                     "post: age = 0"

              ]

              ~InvTests()

              {

                     age = 0;

              }

             

              public int Age

              {

                     get { return age; }

                     set { age = value; }

              }

                          

              public void RunTests()

              {

                     Console.WriteLine("---------------- INV TESTS -----------------");

                     Console.WriteLine("------------ INV TESTS COMPLETE ------------");

              }

       }

}

 

// ------------------------------------------------------------------

// EOF