public void Validate_WhenCalled_AssertShouldNotBeNullWasCalledOnObjectValidatorWithCreditInfoCollection() { ICreditInfoCommand[] creditInfoCommandCollection = _fixture.CreateMany <ICreditInfoCommand>(_random.Next(5, 10)).ToArray(); IAccountDataCommand sut = CreateSut(creditInfoCommandCollection: creditInfoCommandCollection); sut.Validate(_validatorMockContext.ValidatorMock.Object, _accountingRepositoryMock.Object, _commonRepositoryMock.Object); _validatorMockContext.ObjectValidatorMock.Verify(m => m.ShouldNotBeNull( It.Is <IEnumerable <ICreditInfoCommand> >(value => value == creditInfoCommandCollection), It.Is <Type>(type => type == sut.GetType()), It.Is <string>(field => string.CompareOrdinal(field, "CreditInfoCollection") == 0)), Times.Once()); }
public void Validate_WhenCalled_AssertShouldBeBetweenWasCalledOnIntegerValidatorWithAccountGroupNumber() { int accountGroupNumber = _fixture.Create <int>(); IAccountDataCommand sut = CreateSut(accountGroupNumber); sut.Validate(_validatorMockContext.ValidatorMock.Object, _accountingRepositoryMock.Object, _commonRepositoryMock.Object); _validatorMockContext.IntegerValidatorMock.Verify(m => m.ShouldBeBetween( It.Is <int>(value => value == accountGroupNumber), 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, "AccountGroupNumber") == 0)), Times.Once()); }
public void Validate_WhenCalled_AssertShouldBeKnownValueWasCalledOnObjectValidatorWithAccountGroupNumber() { int accountGroupNumber = _fixture.Create <int>(); IAccountDataCommand sut = CreateSut(accountGroupNumber); sut.Validate(_validatorMockContext.ValidatorMock.Object, _accountingRepositoryMock.Object, _commonRepositoryMock.Object); _validatorMockContext.ObjectValidatorMock.Verify(m => m.ShouldBeKnownValue( It.Is <int>(value => value == accountGroupNumber), It.IsNotNull <Func <int, Task <bool> > >(), It.Is <Type>(type => type == sut.GetType()), It.Is <string>(field => String.CompareOrdinal(field, "AccountGroupNumber") == 0), It.Is <bool>(allowNull => allowNull == false)), Times.Once()); }