public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = TargetPropertyName?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ (ComparedValue?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (int)ValueComparingOperator;
         return(hashCode);
     }
 }
Пример #2
0
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = TargetPropertyName != null?TargetPropertyName.GetHashCode() : 0;

                hashCode = (hashCode * 1013) ^ (ComparedValue != null ? ComparedValue.GetHashCode() : 0);
                hashCode = (hashCode * 1013) ^ (int)ValueComparingOperator;
                return(hashCode);
            }
        }
Пример #3
0
        /// <summary>Serves as the default hash function.</summary>
        /// <returns>A hash code for the current object.</returns>
        public override int GetHashCode()
        {
            unchecked
            {
                int hashCode = SourceClassName.GetHashCode();
                hashCode = (hashCode * 397) ^ SourceClassNamespace.GetHashCode();
                hashCode = (hashCode * 397) ^ (int)SourceMultiplicity;
                hashCode = (hashCode * 397) ^ (int)SourceRole;
                hashCode = (hashCode * 397) ^ TargetClassName.GetHashCode();
                hashCode = (hashCode * 397) ^ TargetClassNamespace.GetHashCode();
                hashCode = (hashCode * 397) ^ (int)TargetMultiplicity;
                hashCode = (hashCode * 397) ^ TargetPropertyTypeName.GetHashCode();
                hashCode = (hashCode * 397) ^ TargetPropertyName.GetHashCode();
                hashCode = (hashCode * 397) ^ (int)TargetRole;

                return(hashCode);
            }
        }
        public void WhenCreditCardNumberIsInvalidTestShouldFail(String value)
        {
            // arrange
            _sut.ChaseCreditCardNumber = value;
            String       TargetPropertyValue = value;
            const String TargetPropertyName  = nameof(_sut.ChaseCreditCardNumber);
            String       ExpectedMessage     = String.Format(Strings.CreditCardNumberIsNotAValidCreditCardNumberFormat, TargetPropertyName.GetWords(), TargetPropertyValue);

            // act assert
            base.RunValidation(TargetPropertyName, _sut, ExpectedMessage);
        }
        public void WhenAnyCreditCardCharacterIsNotADigitTestShouldFail(String value)
        {
            // arrange
            _sut.ChaseCreditCardNumber = value;
            String       TargetPropertyValue = value;
            const String TargetPropertyName  = nameof(_sut.ChaseCreditCardNumber);
            String       ExpectedMessage     = String.Format(Strings.CreditCardNumberIsNotAValidCreditCardNumberOnlyNumericInputIsAllowedFormat, TargetPropertyName.GetWords(), TargetPropertyValue);

            // act assert
            base.RunValidation(TargetPropertyName, _sut, ExpectedMessage);
        }
Пример #6
0
        public void WhenLengthIsNotNineTestShouldFail(String value)
        {
            // arrange
            _sut.ChaseBankRoutingNumber = value;
            String       TargetPropertyValue = value;
            const String TargetPropertyName  = nameof(_sut.ChaseBankRoutingNumber);
            String       ExpectedMessage     = String.Format(Strings.ValueIsNotAValidBankRoutingNumberAllBankRoutingNumbersAreNineDigitsInLengthFormat, TargetPropertyName.GetWords(), TargetPropertyValue);

            // act assert
            base.RunValidation(TargetPropertyName, _sut, ExpectedMessage);
        }
Пример #7
0
        public void WhenFirstCharacterIsNotAZeroOrOneTestShouldFail(String value)
        {
            // arrange
            _sut.ChaseBankRoutingNumber = value;
            String       TargetPropertyValue = value;
            const String TargetPropertyName  = nameof(_sut.ChaseBankRoutingNumber);
            String       ExpectedMessage     = String.Format(Strings.ValueIsNotAValidBankRoutingNumberAllBankRoutingNumbersFirstDigitMustBeZeorOrOneFormat, TargetPropertyName.GetWords(), TargetPropertyValue);

            // act assert
            base.RunValidation(TargetPropertyName, _sut, ExpectedMessage);
        }
Пример #8
0
 public override int GetHashCode()
 {
     unchecked {
         return(((TargetPropertyName != null ? TargetPropertyName.GetHashCode() : 0) * 397) ^ (int)ValueComparingOperator ^ ComparedValue.GetHashCode());
     }
 }