示例#1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (commissionRate_ != null)
            {
                hash ^= CommissionRate.GetHashCode();
            }
            if (error_ != null)
            {
                hash ^= Error.GetHashCode();
            }
            if (RequestId != 0)
            {
                hash ^= RequestId.GetHashCode();
            }
            if (IsLast != false)
            {
                hash ^= IsLast.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
示例#2
0
        public void CommissionRates_WhenNotEqual_HaveDifferentHashCodes()
        {
            // Arrange
            var rate1 = new CommissionRate(new CommissionRateValue(0.01m));
            var rate2 = new CommissionRate(new CommissionRateValue(0.02m));

            // Act
            var hashCodesEqual = rate1.GetHashCode() == rate2.GetHashCode();

            // Assert
            hashCodesEqual.Should().BeFalse();
        }
示例#3
0
        public void CommissionRates_WhenEqual_HaveSameHashCode()
        {
            // Arrange
            var rate1 = new CommissionRate(new CommissionRateValue(0.01m));
            var rate2 = new CommissionRate(new CommissionRateValue(0.01m));

            // Act
            var hashCodesEqual = rate1.GetHashCode() == rate2.GetHashCode();

            // Assert
            hashCodesEqual.Should().BeTrue();
        }