Пример #1
0
        public void DeviceListEqualityTest()
        {
            var dateTimeOffset = DateTimeOffset.Now;

            var left = new DeviceList
            {
                DeviceId = "id",
                LastApp = "lastapp",
                LastHeard = dateTimeOffset,
                Name = "name",
                LastIpAddress = "127.0.0.1",
                ProductId = 6,
                Connected = true
            };

            var right = new DeviceList
            {
                DeviceId = "id",
                LastApp = "lastapp",
                LastHeard = dateTimeOffset,
                Name = "name",
                LastIpAddress = "127.0.0.1",
                ProductId = 6,
                Connected = true
            };

            Assert.AreEqual(left.GetHashCode(), right.GetHashCode());
            Assert.AreEqual(left, right);
        }
Пример #2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Topic.Length != 0)
            {
                hash ^= Topic.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.Client)
            {
                hash ^= Client.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.Device)
            {
                hash ^= Device.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.TopicSubscription)
            {
                hash ^= TopicSubscription.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.Session)
            {
                hash ^= Session.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.SessionList)
            {
                hash ^= SessionList.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.ProcessingModule)
            {
                hash ^= ProcessingModule.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.ProcessingModuleList)
            {
                hash ^= ProcessingModuleList.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.TopicMux)
            {
                hash ^= TopicMux.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.TopicMuxList)
            {
                hash ^= TopicMuxList.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.TopicDemux)
            {
                hash ^= TopicDemux.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.TopicDemuxList)
            {
                hash ^= TopicDemuxList.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.ClientList)
            {
                hash ^= ClientList.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.DeviceList)
            {
                hash ^= DeviceList.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.LockstepProcessingRequest)
            {
                hash ^= LockstepProcessingRequest.GetHashCode();
            }
            hash ^= (int)typeCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Пример #3
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (typeCase_ == TypeOneofCase.Success)
            {
                hash ^= Success.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.Error)
            {
                hash ^= Error.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.Client)
            {
                hash ^= Client.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.Device)
            {
                hash ^= Device.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.Server)
            {
                hash ^= Server.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.Session)
            {
                hash ^= Session.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.SessionList)
            {
                hash ^= SessionList.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.ProcessingModule)
            {
                hash ^= ProcessingModule.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.ProcessingModuleList)
            {
                hash ^= ProcessingModuleList.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.StringList)
            {
                hash ^= StringList.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.TopicMux)
            {
                hash ^= TopicMux.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.TopicMuxList)
            {
                hash ^= TopicMuxList.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.TopicDemux)
            {
                hash ^= TopicDemux.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.TopicDemuxList)
            {
                hash ^= TopicDemuxList.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.ClientList)
            {
                hash ^= ClientList.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.DeviceList)
            {
                hash ^= DeviceList.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.Service)
            {
                hash ^= Service.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.ServiceList)
            {
                hash ^= ServiceList.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.LockstepProcessingReply)
            {
                hash ^= LockstepProcessingReply.GetHashCode();
            }
            hash ^= (int)typeCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }