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); }
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); }
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); }