Ejemplo n.º 1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Id.Length != 0)
            {
                hash ^= Id.GetHashCode();
            }
            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (Ip.Length != 0)
            {
                hash ^= Ip.GetHashCode();
            }
            if (Port.Length != 0)
            {
                hash ^= Port.GetHashCode();
            }
            if (Mac.Length != 0)
            {
                hash ^= Mac.GetHashCode();
            }
            if (Hostname.Length != 0)
            {
                hash ^= Hostname.GetHashCode();
            }
            if (Description.Length != 0)
            {
                hash ^= Description.GetHashCode();
            }
            if (Key.Length != 0)
            {
                hash ^= Key.GetHashCode();
            }
            if (IsMaster != false)
            {
                hash ^= IsMaster.GetHashCode();
            }
            if (UpdateTs.Length != 0)
            {
                hash ^= UpdateTs.GetHashCode();
            }
            if (CreateTs.Length != 0)
            {
                hash ^= CreateTs.GetHashCode();
            }
            if (UpdateTsUnix != 0L)
            {
                hash ^= UpdateTsUnix.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Ejemplo n.º 2
0
        public void It_Should_Acquire_MasterRole_When_Lock_Is_Free()
        {
            //Arrange

            _provider !.Setup(provider => provider.LockAsync(_clusterInformation !.ClusterName))
            .ReturnsAsync(new LockReference(true));

            //Act
            _sut !.Claim().Wait();

            //Assert
            _sut !.IsMaster.Should().BeTrue();
        }