public void NullSessionGuidValueValidator()
        {
            _testLeadEntity.Context = new IContext[] { new DefaultContext(Modules.LeadEntity.Interface.Constants.ContextKeys.SessionGuidKey, null) };
            var sessionGuidValidator = new SessionGuidValidator();

            var actualValue = sessionGuidValidator.ValidLead(_testLeadEntity);

            bool expectedValue = false;

            Assert.AreEqual(expectedValue, actualValue);
        }
        public void ValidSessionGuidValidator()
        {
            _testLeadEntity.Context = new IContext[] { new DefaultContext(Modules.LeadEntity.Interface.Constants.ContextKeys.SessionGuidKey, Guid.NewGuid().ToString()) };
            var sessionGuidValidator = new SessionGuidValidator();

            var actualValue = sessionGuidValidator.ValidLead(_testLeadEntity);

            bool expectedValue = true;

            Assert.AreEqual(expectedValue, actualValue);
        }
        public void InvalidSessionGuidValidatorKey()
        {
            _testLeadEntity.Context = new IContext[] { new DefaultContext(null, Guid.NewGuid().ToString()) };
            var sessionGuidValidator = new SessionGuidValidator();

            var actualValue = sessionGuidValidator.ValidLead(_testLeadEntity);

            bool expectedValue = false;

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

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

            sessionGuid.ValidLead(_testLeadEntity);

            bool expectedValue = false;

            var actualValue = validator.ValidLead(_testLeadEntity);

            Assert.AreEqual(expectedValue, actualValue);
        }