Example #1
0
        public void MatchRelationship()
        {
            using (var client = new NeoClient(URL, USER, PASSWORD, CONFIG))
            {
                client.Connect();

                User user1 = client.Add(new User {
                    Email = "FakeEmail1", FirstName = "FakeFirstName1", LastName = "FakeLastName1"
                });
                User user2 = client.Add(new User {
                    Email = "FakeEmail2", FirstName = "FakeFirstName2", LastName = "FakeLastName2"
                });

                var relationship = new RelationshipAttribute
                {
                    Direction = DIRECTION.INCOMING,
                    Name      = "BROTHER"
                };

                bool isCreatedRelationship = client.CreateRelationship(
                    user1.Uuid,
                    user2.Uuid,
                    relationship
                    );

                bool isUpdatedRelatiionship = client.MergeRelationship(
                    uuidFrom: user1.Uuid,
                    uuidTo: user2.Uuid,
                    relationshipAttribute: relationship
                    );

                isCreatedRelationship.Should().BeTrue();
                isUpdatedRelatiionship.Should().BeTrue();
            }
        }