public void Validate_WhenCalled_AssertShouldHaveMaxLengthWasCalledOnStringValidatorForMailAddress()
        {
            string mailAddress             = _fixture.Create <string>();
            IContactAccountDataCommand sut = CreateSut(mailAddress);

            sut.Validate(_validatorMockContext.ValidatorMock.Object, _accountingRepositoryMock.Object, _commonRepositoryMock.Object);

            _validatorMockContext.StringValidatorMock.Verify(m => m.ShouldHaveMaxLength(
                                                                 It.Is <string>(value => string.CompareOrdinal(value, mailAddress) == 0),
                                                                 It.Is <int>(value => value == 256),
                                                                 It.Is <Type>(value => value == sut.GetType()),
                                                                 It.Is <string>(value => string.CompareOrdinal(value, "MailAddress") == 0),
                                                                 It.Is <bool>(value => value)),
                                                             Times.Once);
        }
        public void Validate_WhenCalled_AssertShouldBeKnownValueWasCalledOnObjectValidatorWithPaymentTermNumber()
        {
            int paymentTermNumber          = _fixture.Create <int>();
            IContactAccountDataCommand sut = CreateSut(paymentTermNumber: paymentTermNumber);

            sut.Validate(_validatorMockContext.ValidatorMock.Object, _accountingRepositoryMock.Object, _commonRepositoryMock.Object);

            _validatorMockContext.ObjectValidatorMock.Verify(m => m.ShouldBeKnownValue(
                                                                 It.Is <int>(value => value == paymentTermNumber),
                                                                 It.IsNotNull <Func <int, Task <bool> > >(),
                                                                 It.Is <Type>(type => type == sut.GetType()),
                                                                 It.Is <string>(field => String.CompareOrdinal(field, "PaymentTermNumber") == 0),
                                                                 It.Is <bool>(allowNull => allowNull == false)),
                                                             Times.Once());
        }
        public void Validate_WhenCalled_AssertShouldMatchPatternWasCalledOnStringValidatorForSecondaryPhone()
        {
            string secondaryPhone          = _fixture.Create <string>();
            IContactAccountDataCommand sut = CreateSut(secondaryPhone: secondaryPhone);

            sut.Validate(_validatorMockContext.ValidatorMock.Object, _accountingRepositoryMock.Object, _commonRepositoryMock.Object);

            _validatorMockContext.StringValidatorMock.Verify(m => m.ShouldMatchPattern(
                                                                 It.Is <string>(value => string.CompareOrdinal(value, secondaryPhone) == 0),
                                                                 It.Is <Regex>(value => string.CompareOrdinal(value.ToString(), RegexTestHelper.PhoneNumberRegexPattern) == 0),
                                                                 It.Is <Type>(value => value == sut.GetType()),
                                                                 It.Is <string>(value => string.CompareOrdinal(value, "SecondaryPhone") == 0),
                                                                 It.Is <bool>(value => value)),
                                                             Times.Once);
        }
        public void Validate_WhenCalled_AssertShouldBeBetweenWasCalledOnIntegerValidatorWithPaymentTermNumber()
        {
            int paymentTermNumber          = _fixture.Create <int>();
            IContactAccountDataCommand sut = CreateSut(paymentTermNumber: paymentTermNumber);

            sut.Validate(_validatorMockContext.ValidatorMock.Object, _accountingRepositoryMock.Object, _commonRepositoryMock.Object);

            _validatorMockContext.IntegerValidatorMock.Verify(m => m.ShouldBeBetween(
                                                                  It.Is <int>(value => value == paymentTermNumber),
                                                                  It.Is <int>(minValue => minValue == 1),
                                                                  It.Is <int>(maxValue => maxValue == 99),
                                                                  It.Is <Type>(type => type == sut.GetType()),
                                                                  It.Is <string>(field => String.CompareOrdinal(field, "PaymentTermNumber") == 0)),
                                                              Times.Once());
        }
        public void Validate_WhenCalled_AssertShouldHaveMinLengthWasCalledOnStringValidatorForSecondaryPhone()
        {
            string secondaryPhone          = _fixture.Create <string>();
            IContactAccountDataCommand sut = CreateSut(secondaryPhone: secondaryPhone);

            sut.Validate(_validatorMockContext.ValidatorMock.Object, _accountingRepositoryMock.Object, _commonRepositoryMock.Object);

            _validatorMockContext.StringValidatorMock.Verify(m => m.ShouldHaveMinLength(
                                                                 It.Is <string>(value => string.CompareOrdinal(value, secondaryPhone) == 0),
                                                                 It.Is <int>(value => value == 1),
                                                                 It.Is <Type>(value => value == sut.GetType()),
                                                                 It.Is <string>(value => string.CompareOrdinal(value, "SecondaryPhone") == 0),
                                                                 It.Is <bool>(value => value)),
                                                             Times.Once);
        }