Example #1
0
        public void NullIdentityGuidValueValidator()
        {
            _testLeadEntity.Context = new IContext[] { new DefaultContext(Modules.LeadEntity.Interface.Constants.ContextKeys.IdentityGuidKey, null) };
            var identityGuidValidator = new IdentityGuidValidator();

            var actualValue = identityGuidValidator.ValidLead(_testLeadEntity);

            bool expectedValue = false;

            Assert.AreEqual(expectedValue, actualValue);
        }
Example #2
0
        public void ValidIdentityGuidValidator()
        {
            _testLeadEntity.Context = new IContext[] { new DefaultContext(Modules.LeadEntity.Interface.Constants.ContextKeys.IdentityGuidKey, Guid.NewGuid().ToString()) };
            var identityGuidValidator = new IdentityGuidValidator();

            var actualValue = identityGuidValidator.ValidLead(_testLeadEntity);

            bool expectedValue = true;

            Assert.AreEqual(expectedValue, actualValue);
        }
Example #3
0
        public void InvalidIdentityGuidValidatorKey()
        {
            _testLeadEntity.Context = new IContext[] { new DefaultContext(null, Guid.NewGuid().ToString()) };
            var identityGuidValidator = new IdentityGuidValidator();

            var actualValue = identityGuidValidator.ValidLead(_testLeadEntity);

            bool expectedValue = false;

            Assert.AreEqual(expectedValue, actualValue);
        }
Example #4
0
        public void IdentityGuidValidator()
        {
            var validator = _serviceProvider.GetService <IValidator>();

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

            identityGuid.ValidLead(_testLeadEntity);

            bool expectedValue = false;

            var actualValue = validator.ValidLead(_testLeadEntity);

            Assert.AreEqual(expectedValue, actualValue);
        }