コード例 #1
0
        public StateValidatorTests()
        {
            context   = new TestingContext();
            validator = new StateValidator(new UnitOfWork(context));

            context.DropData();
            SetUpData();
        }
コード例 #2
0
ファイル: ValidatorTests.cs プロジェクト: btcoetzee/LMS
        public void StateIdValidator()
        {
            var validator = _serviceProvider.GetService <IValidator>();

            _testLeadEntity.Properties = new IProperty[] { new DefaultProperty(Modules.LeadEntity.Interface.Constants.PropertyKeys.StateKey, "VA") };
            var stateId = new StateValidator();

            stateId.ValidLead(_testLeadEntity);

            bool expectedValue = false;

            var actualValue = validator.ValidLead(_testLeadEntity);

            Assert.AreEqual(expectedValue, actualValue);
        }
コード例 #3
0
        public ValidationService(IPrimaryContext context)
        {
            Context                  = context;
            _contactvalidator        = new ContactValidator();
            _customervalidator       = new CustomerValidator();
            _userValidator           = new UserValidator(context);
            _customerSourceValidator = new CustomerSourceValidator(context);

            _serviceAreaValidator      = new ServiceAreaValidator(context);
            _serviceDivisionValidator  = new ServiceDivisionValidator(context);
            _unitTypeValidator         = new UnitTypeValidator(context);
            _stateValidator            = new StateValidator(context);
            _goodsValidator            = new GoodsValidator(context);
            _customerLocationValidator = new CustomerLocationValidator(context);
            _contractValidator         = new ContractValidator(context);
            _locationServiceValidator  = new LocationServiceValidator(context);
        }
コード例 #4
0
 protected override string PropertyValidation(PropertyInfo pi)
 {
     return(base.PropertyValidation(pi) ?? StateValidator.Validate(this, pi));
 }