Example #1
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked {
         var hashCode = MaxWaitTime.GetHashCode();
         hashCode = (hashCode * 397) ^ MinBytes;
         hashCode = (hashCode * 397) ^ MaxBytes;
         hashCode = (hashCode * 397) ^ (Topics?.GetHashCode() ?? 0);
         return(hashCode);
     }
 }
Example #2
0
        public void EnableBatchProcessing_ValidBatchSettings_BatchSettingsSet(int size)
        {
            var builder = new TestConsumerEndpointBuilder();

            var endpoint = builder.EnableBatchProcessing(size, TimeSpan.FromMinutes(42)).Build();

            endpoint.Batch.Should().NotBeNull();
            endpoint.Batch !.Size.Should().Be(size);
            endpoint.Batch !.MaxWaitTime.Should().Be(TimeSpan.FromMinutes(42));
        }
Example #3
0
 /// <inheritdoc />
 public bool Equals(FetchRequest other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(MaxWaitTime.Equals(other.MaxWaitTime) &&
            MinBytes == other.MinBytes &&
            MaxBytes == other.MaxBytes &&
            Topics.HasEqualElementsInOrder(other.Topics));
 }
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (MaxWaitTime != null)
         {
             hashCode = hashCode * 59 + MaxWaitTime.GetHashCode();
         }
         if (MinWaitBetweenRetries != null)
         {
             hashCode = hashCode * 59 + MinWaitBetweenRetries.GetHashCode();
         }
         return(hashCode);
     }
 }
        /// <summary>
        /// Returns true if ComAdobeCqSocialGroupImplGroupServiceImplProperties instances are equal
        /// </summary>
        /// <param name="other">Instance of ComAdobeCqSocialGroupImplGroupServiceImplProperties to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ComAdobeCqSocialGroupImplGroupServiceImplProperties other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     MaxWaitTime == other.MaxWaitTime ||
                     MaxWaitTime != null &&
                     MaxWaitTime.Equals(other.MaxWaitTime)
                     ) &&
                 (
                     MinWaitBetweenRetries == other.MinWaitBetweenRetries ||
                     MinWaitBetweenRetries != null &&
                     MinWaitBetweenRetries.Equals(other.MinWaitBetweenRetries)
                 ));
        }