public void Validate_WhenCalled_ReturnsValidator()
        {
            IGetPostalCodeQuery sut = CreateSut();

            IValidator result = sut.Validate(_validatorMockContext.ValidatorMock.Object, _contactRepositoryMock.Object);

            Assert.That(result, Is.EqualTo(_validatorMockContext.ValidatorMock.Object));
        }
        public void Validate_WhenCalled_AssertShouldBeKnownValueWasCalledOnObjectValidator()
        {
            string countryCode      = _fixture.Create <string>();
            IGetPostalCodeQuery sut = CreateSut(countryCode);

            sut.Validate(_validatorMockContext.ValidatorMock.Object, _contactRepositoryMock.Object);

            _validatorMockContext.ObjectValidatorMock.Verify(m => m.ShouldBeKnownValue(
                                                                 It.Is <string>(value => string.CompareOrdinal(value, countryCode.ToUpper()) == 0),
                                                                 It.IsNotNull <Func <string, Task <bool> > >(),
                                                                 It.Is <Type>(value => sut.GetType() == value),
                                                                 It.Is <string>(value => string.CompareOrdinal(value, "CountryCode") == 0),
                                                                 It.Is <bool>(value => value == false)),
                                                             Times.Once());
        }
        public void Validate_WhenContactRepositoryIsNull_ThrowsArgumentNullException()
        {
            IGetPostalCodeQuery sut = CreateSut();

            ArgumentNullException result = Assert.Throws <ArgumentNullException>(() => sut.Validate(_validatorMockContext.ValidatorMock.Object, null));

            Assert.That(result.ParamName, Is.EqualTo("contactRepository"));
        }