public void TupleTypeTest() { OclClassifier type1 = OclTupleType.Tuple(OclTupleType.Part("i", OclInteger.Type), OclTupleType.Part("s", OclString.Type)); OclClassifier type11 = OclTupleType.Tuple(OclTupleType.Part("i", OclInteger.Type), OclTupleType.Part("s", OclString.Type)); OclClassifier type2 = OclTupleType.Tuple(OclTupleType.Part("i", OclReal.Type), OclTupleType.Part("s", OclString.Type)); OclClassifier type3 = OclTupleType.Tuple(OclTupleType.Part("x", OclInteger.Type), OclTupleType.Part("s", OclString.Type)); OclClassifier type4 = OclTupleType.Tuple(OclTupleType.Part("s", OclString.Type), OclTupleType.Part("i", OclInteger.Type)); TestUtils.AreEqual(type1, type11); TestUtils.AreNotEqual(type1, type2); TestUtils.AreNotEqual(type1, type3); TestUtils.AreNotEqual(type1, type4); TestConformantToSelf(type1); TestUtils.AreEqual(OclBoolean.True, type1.conformsTo(type11)); TestUtils.AreEqual(OclBoolean.True, type11.conformsTo(type1)); TestConformant(type1, type2); TestNonConformant(type1, type3); TestNonConformant(type1, type4); }
private void TestConformantToSelf(OclClassifier classifier) { TestUtils.AreEqual(OclBoolean.True, classifier.conformsTo(classifier)); }
private void TestNonConformant(OclClassifier classifier, OclClassifier to) { TestUtils.AreEqual(OclBoolean.False, classifier.conformsTo(to)); TestUtils.AreEqual(OclBoolean.False, to.conformsTo(classifier)); }