#!/usr/bin/env python
import coral
L = coral.lang.UML14

b = coral.Boolean.newAtom()

print type(b.__type__())
assert isinstance(b.__type__(), coral.EnumerationDefinition)

b= coral.Boolean.true
assert(b)
assert(not (not b))

if b:
    pass
else:
    assert 0

b = coral.Boolean.false
print type(b)
if b:
    assert 0
else:
    pass

b = coral.Boolean.newAtom()
if b:
    assert 0
else:
    pass

b.__setEValue__(1)
if b:
    pass
else:
    assert 0

import coral


p=L.Parameter()
#test default value
print p.kind

#test assignment
p.kind = L.ParameterDirectionKind._in
p.kind = L.ParameterDirectionKind._return

# Test the eq operator
assert p.kind == "return"
assert p.kind == L.ParameterDirectionKind._return

# Test the ne operator
assert p.kind != L.ParameterDirectionKind._in

a=L.AssociationEnd()

a.isNavigable=coral.Boolean.true

assert(a.isNavigable)
assert(not (not a.isNavigable))

a.isNavigable=coral.Boolean.false

print a.isNavigable
assert(not a.isNavigable)
if a.isNavigable:
    assert(1!=1)
assert(not(not(not a.isNavigable)))

a.isNavigable = "true"
assert a.isNavigable

a.isNavigable = "false"
assert not a.isNavigable
