Пример #1
0
        public void NullActivityGuidValueValidator()
        {
            _testLeadEntity.Context = new IContext[] { new DefaultContext(LeadEntity.Interface.Constants.ContextKeys.ActivityGuidKey, null) };
            var activityGuidValidator = new ActivityGuidValidator();

            var actualValue = activityGuidValidator.ValidLead(_testLeadEntity);

            bool expectedValue = false;

            Assert.AreEqual(expectedValue, actualValue);
        }
Пример #2
0
        public void ValidActivityGuidValidator()
        {
            _testLeadEntity.Context = new IContext[] { new DefaultContext(LeadEntity.Interface.Constants.ContextKeys.ActivityGuidKey, Guid.NewGuid().ToString()) };
            var activityGuidValidator = new ActivityGuidValidator();

            var actualValue = activityGuidValidator.ValidLead(_testLeadEntity);

            bool expectedValue = true;

            Assert.AreEqual(expectedValue, actualValue);
        }
Пример #3
0
        public void InvalidActivityGuidValidatorKey()
        {
            _testLeadEntity.Context = new IContext[] { new DefaultContext(null, Guid.NewGuid().ToString()) };
            var activityGuidValidator = new ActivityGuidValidator();

            var actualValue = activityGuidValidator.ValidLead(_testLeadEntity);

            bool expectedValue = false;

            Assert.AreEqual(expectedValue, actualValue);
        }
Пример #4
0
        public void ActivityGuidValidator()
        {
            var validator = _serviceProvider.GetService <IValidator>();

            _testLeadEntity.Context = new IContext[] { new DefaultContext(Modules.LeadEntity.Interface.Constants.ContextKeys.ActivityGuidKey, Guid.NewGuid().ToString()) };
            var activityGuid = new ActivityGuidValidator();

            activityGuid.ValidLead(_testLeadEntity);

            bool expectedValue = false;

            var actualValue = validator.ValidLead(_testLeadEntity);

            Assert.AreEqual(expectedValue, actualValue);
        }