Name: SampleClass1

Properties:
  stringProperty:
    Contract: $.string().notNull()
  classProperty:
    Contract: $.class(SampleClass2).notNull()
  assignedProperty:
    Contract: $
    Usage: Runtime
  arbitraryProperty:
    Contract: $

Workflow:
  testTrace:
    Arguments:
      - intArg:
          Contract: $.int().notNull()
    Body:
      - trace($intArg)
      - trace($.stringProperty)
      - trace($.classProperty.class2Property)

  testException:
    Body:
      - raiseException()

  testReturn:
    Arguments:
      - intArg:
          Contract: $.int().notNull()
    Body:
      Return: $intArg

  testCallAnotherMethod:
    Body:
      - trace(method1)
      - $.anotherMethod()

  anotherMethod:
    Body:
      - trace(method2)

  testAttributes:
    Arguments:
      - arg:
          Contract: $.string()
    Body:
      - $.setAttr(att1, $arg)
      - $x: $.getAttr(att1)
      - $y: $.getAttr(att2, ' Doe')
      - Return: $x + $y

  testAssignment:
    Body:
      - $result: {}
      - $result.Arr: [1, 2, [10, 11]]
      - $index: 1
      - $result.Arr[0]: 3
      - $result.Arr[$index - 1]: 5
      - $result.Arr[$index + 1][1]: 123
      #- $result.Dict: {}
      - $result.Dict.Key1: V1
      - $keyName: Key2
      - $result.Dict[$keyName]: {}
      - $result.Dict[$keyName]['a_b']: V2
      - $result.Dict[$keyName][toUpper($keyName)]: V3
      - Return: $result

  testAssignmentOnProperty:
    Body:
      #- $.assignedProperty: {}
      - $.assignedProperty.Arr: [1, 2, [10, 11]]
      - $index: 1
      - $.assignedProperty.Arr[0]: 3
      - $.assignedProperty.Arr[$index - 1]: 5
      - $.assignedProperty.Arr[$index + 1][1]: 123
      #- $.assignedProperty.Dict: {}
      - $.assignedProperty.Dict.Key1: V1
      - $keyName: Key2
      - $.assignedProperty.Dict[$keyName]: {}
      - $.assignedProperty.Dict[$keyName]['a_b']: V2
      - $.assignedProperty.Dict[$keyName][toUpper($keyName)]: V3
      - Return: $.assignedProperty


  testAssignByCopy:
    Arguments:
      - arg:
          Contract: [$.int()]
    Body:
      - $x: $arg
      - $x[0]: 321
      - Return: $arg
