public void FromRelationMemberInfo_CreatesRelationMember()
        {
            RelationMemberInfo info = new RelationMemberInfo() { Reference = 1, MemberType = EntityType.Node, Role = "role" };
            RelationMember target = RelationMember.FromRelationMemberInfo(info, _nodesEntityCollection, true);

            Assert.Equal(info.Reference, target.Member.ID);
            Assert.Equal(info.Role, target.Role);
            Assert.Equal(info.MemberType, target.MemberType);
        }
        public void FromRelationMemberInfo_ThrowExceptionIfReferencedEntityTypeDoesntMatchMemberType()
        {
            RelationMemberInfo info = new RelationMemberInfo() { Reference = 1, MemberType = EntityType.Way, Role = "role" };

            Assert.Throws<ArgumentException>(() => RelationMember.FromRelationMemberInfo(info, _nodesEntityCollection, true));
        }
        public void FromRelationMemberInfo_ThrowExceptionIfReferencedEntityIsNotAvailable()
        {
            RelationMemberInfo info = new RelationMemberInfo() { Reference = 10000, MemberType = EntityType.Node, Role = "role" };

            Assert.Throws<ArgumentException>(() => RelationMember.FromRelationMemberInfo(info, _nodesEntityCollection, true));
        }
        public void FromRelationMemberInfo_ReturnsNullIfReferencedEntityIsNotAvailableAndThrowOnMissingIsFalse()
        {
            RelationMemberInfo info = new RelationMemberInfo() { Reference = 10000, MemberType = EntityType.Node, Role = "role" };

            Assert.Null(RelationMember.FromRelationMemberInfo(info, _nodesEntityCollection, false));
        }
        public void FromRelationMemberInfo_ThrowExceptionIfTypeIsUnknown()
        {
            RelationMemberInfo info = new RelationMemberInfo() { Reference = 1, MemberType = EntityType.Unknown, Role = "role" };

            Assert.Throws<ArgumentException>(() => RelationMember.FromRelationMemberInfo(info, _nodesEntityCollection, true));
        }