Inheritance: AbstractRelationType
コード例 #1
0
 public HiveRelationCacheKey(RepositoryTypes repositoryType, HiveId entityId, Direction direction, RelationType relationType)
 {
     RepositoryType = repositoryType;
     EntityId = entityId;
     Direction = direction;
     RelationType = relationType;
 }
コード例 #2
0
        public void CanSerializeRelationToJson()
        {
            var sourceId = new HiveId(Guid.NewGuid());
            var destinationId = new HiveId(Guid.NewGuid());
            var relationType = new RelationType("DefaultRelation");
            var relation = new RelationById(sourceId, destinationId, relationType, 0);

            var result = SerializationService.ToStream(relation);

            Assert.That(result.Success, Is.True);
            Assert.That(result.ResultStream, Is.Not.Null);

            string json = result.ResultStream.ToJsonString();
            Assert.That(json, Is.Not.Empty);
            Assert.That(json.StartsWith("{"), Is.True);
            Assert.That(json.EndsWith("}"));
        }