Esempio n. 1
0
                public override Task <ClusterInfo> Read(Empty request, ServerCallContext context)
                {
                    if (_currentClusterInfo.Members == null)
                    {
                        return(Task.FromResult(new ClusterInfo()));
                    }
                    var members = Array.ConvertAll(_currentClusterInfo.Members, x => new MemberInfo {
                        InstanceId   = Uuid.FromGuid(x.InstanceId).ToDto(),
                        State        = (MemberInfo.Types.VNodeState)x.State,
                        IsAlive      = x.IsAlive,
                        HttpEndPoint = new Gossip.EndPoint {
                            Address = x.HttpEndPointAddress,
                            Port    = (uint)x.HttpEndPointPort
                        }
                    }).ToArray();
                    var info = new ClusterInfo();

                    info.Members.AddRange(members);
                    return(Task.FromResult(info));
                }
        public void Equality()
        {
            var sut = Uuid.NewUuid();

            Assert.Equal(Uuid.FromGuid(sut.ToGuid()), sut);
        }
        public void EqualityOperator()
        {
            var sut = Uuid.NewUuid();

            Assert.True(Uuid.FromGuid(sut.ToGuid()) == sut);
        }