public void ReflexiveRelationTest() { var s = new Set <int>(); s.Add(2); // In the reflexive check, it is not necessary to have the elements // in the relation, as every element in the set will participate (?) var r = new ReflexiveRelation2 <int>(); r.Add(new OrderedTuple2 <int>(2, 4)); s.relations.Add(r); Assert.AreEqual(true, s.Is <ReflexiveRelation2 <int> >(2, 2)); Assert.AreEqual(true, s.Is <ReflexiveRelation2 <int> >(4, 4)); Assert.AreEqual(false, s.Is <ReflexiveRelation2 <int> >(1, 1)); Assert.AreEqual(false, s.Is <ReflexiveRelation2 <int> >(2, 3)); }
public void ReflexiveRelationTest() { var s = new Set <int>(); s.elems.Add(2); // In the reflexive check, it is not necessary to have the elements // in the relation, as every element in the set will participate (?) var r = new ReflexiveRelation2 <int>(); s.relations.Add(r); Assert.AreEqual((typeof(ReflexiveRelationAttribute), true), s.Is <ReflexiveRelation2 <int> >(2, 2)); Assert.AreEqual((typeof(RelationKindAttribute), false), s.Is <ReflexiveRelation2 <int> >(1, 1)); Assert.AreEqual((typeof(RelationKindAttribute), false), s.Is <ReflexiveRelation2 <int> >(2, 3)); }