public void IsSelfReferencing_returns_true_when_ends_have_same_base_type()
        {
            var associationType = new AssociationType("A", XmlConstants.ModelNamespace_3, false, DataSpace.CSpace);

            associationType.SourceEnd = new AssociationEndMember("S", new EntityType("E", "N", DataSpace.CSpace));
            associationType.TargetEnd = new AssociationEndMember("T", new EntityType("E", "N", DataSpace.CSpace));

            Assert.False(associationType.IsSelfReferencing());

            associationType.SourceEnd.GetEntityType().BaseType
                  = associationType.TargetEnd.GetEntityType().BaseType
                  = new EntityType("E", "N", DataSpace.CSpace);

            Assert.True(associationType.IsSelfReferencing());
        }
        public void IsSelfReferencing_returns_true_when_ends_have_same_base_type()
        {
            var associationType = new AssociationType();

            associationType.SourceEnd = new AssociationEndMember("S", new EntityType());
            associationType.TargetEnd = new AssociationEndMember("T", new EntityType());

            Assert.False(associationType.IsSelfReferencing());

            associationType.SourceEnd.GetEntityType().BaseType
                  = associationType.TargetEnd.GetEntityType().BaseType
                  = new EntityType();

            Assert.True(associationType.IsSelfReferencing());
        }
        public void IsSelfReferencing_returns_true_when_source_type_matches_target_type()
        {
            var associationType = new AssociationType();

            associationType.SourceEnd = new AssociationEndMember("S", new EntityType());
            associationType.TargetEnd = new AssociationEndMember("T", associationType.SourceEnd.GetEntityType());

            Assert.True(associationType.IsSelfReferencing());
        }