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

// Any.cs: Represents OCL testing for the OclAny STL type

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

// 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 the OclAny expressions

      class AnyTests

      {

            OCL

            [

                  "context AnyTests::_a1 : Boolean"

                  "init: 1.oclIsUndefined()"

            ]

            private bool _a1;

           

            OCL

            [

                  "context AnyTests::_a2 : Boolean"

                  "init: 1.1.oclIsUndefined()"

            ]

            private bool _a2;

           

            OCL

            [

                  "context AnyTests::_a3 : Boolean"

                  "init: true.oclIsUndefined()"

            ]

            private bool _a3;

           

            OCL

            [

                  "context AnyTests::_a4 : Boolean"

                  "init: 'Hello'.oclIsUndefined()"

            ]

            private bool _a4;

           

            OCL

            [

                  "context AnyTests::_a5 : Boolean"

                  "init: OclVoid.oclIsUndefined()"

            ]

            private bool _a5;

           

           

            public void RunTests()

            {

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

                  Console.WriteLine("A1 (1.oclIsUndefined(): {0}", _a1);

                  Console.WriteLine("A2 (1.1.oclIsUndefined(): {0}", _a2);

                  Console.WriteLine("A3 (true.oclIsUndefined(): {0}", _a3);

                  Console.WriteLine("A4 ('Hello'.oclIsUndefined(): {0}", _a4);

                  Console.WriteLine("A5 (OclVoid.oclIsUndefined(): {0}", _a5);

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

            }

      }

}

 

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

// EOF