Ejemplo n.º 1
0
        public void ValidLeadWithEmptyContextTest()
        {
            var validator = new LeadValidator(_validatorFactory.Object,_loggingClient.Object);

            _testLeadEntity.Context = null;
            bool expectedValue = false;

            var isValid = validator.ValidLead(_testLeadEntity);

            Assert.AreEqual(expectedValue, isValid);

        }
Ejemplo n.º 2
0
        public void ValidLeadWithEmptyContextKeysTest()
        {
            var validator = new LeadValidator(_validatorFactory.Object,_loggingClient.Object);

            activityId = null;
            identityId = null;
            sessionId = null;
            quotedProductId = null;
            bool expectedValue = false;

            var isValid = validator.ValidLead(_testLeadEntity);

            Assert.AreEqual(expectedValue, isValid);

        }
Ejemplo n.º 3
0
        public void InvalidLeadTest()
        {
            var validator = new LeadValidator(_validatorFactory.Object, _loggingClient.Object);
            _testLeadEntity.Context = new IContext[] { new DefaultContext ( LMS.Modules.LeadEntity.Interface.Constants.ContextKeys.ActivityGuidKey, Guid.NewGuid().ToString() ) ,
                                                       new DefaultContext ( LMS.Modules.LeadEntity.Interface.Constants.ContextKeys.SessionGuidKey, Guid.NewGuid().ToString() )  ,
                                                       new DefaultContext ( LMS.Modules.LeadEntity.Interface.Constants.ContextKeys.IdentityGuidKey, Guid.NewGuid().ToString() ) ,
                                                       new DefaultContext ( LMS.Modules.LeadEntity.Interface.Constants.ContextKeys.QuotedProductKey, Guid.NewGuid().ToString() )
            };

            //activityId = "ActivityGUID";
            //identityId = "IdentityGUID";
            //sessionId = "SessionGUID";
            //quotedProductId = "QuotedProduct";
            bool expectedValue = false;
            ////var activityGuidValue = _testLeadEntity.Context.SingleOrDefault(item => item.Id == _testLeadEntity..Interface.Constants.ContextKeys.ActivityGuidKey)?.Value;

            var isValid = validator.ValidLead(_testLeadEntity);

            Assert.AreEqual(expectedValue, isValid);

        }