Conversation
TomMalow
left a comment
There was a problem hiding this comment.
The test are missing asserts that verifies that data have been created in the mockup database.
The Qualify lead process does not currently create any Opportunities and are missing some checks such as it should not be possible to add an existing account to the qualifying process with out requiring creation of a new Opportunity.
Qualify lead does not handle any kind of duplicate detection when creating new account or contacts.
| } | ||
|
|
||
| var resp = new QualifyLeadResponse(); | ||
| resp.Results["CreatedEntities"] = createdEntities; |
There was a problem hiding this comment.
You also need to create the entities in the mockup database. Currently you just respond with almost the same data as the user has requested. Additionally, you also need to update the state of the Lead to Qualified.
| } | ||
|
|
||
| [TestMethod] | ||
| public void TestQualifyLeadRequestCreateAccountSuccess() |
There was a problem hiding this comment.
Missing assert that lead has been qualified and that a new account has been created
| } | ||
|
|
||
| [TestMethod] | ||
| public void TestQualifyLeadRequestOpportunityCustomerIdSuccess() |
There was a problem hiding this comment.
Missing assert that lead has been qualified. This test should also fails as you need to also set CreateOpportunity if you want to set OpportunityCustomerId as it defines an existing account that the opportunity should point to
| } | ||
|
|
||
| [TestMethod] | ||
| public void TestQualifyLeadRequestCreateContactSuccess() |
There was a problem hiding this comment.
Missing assert that lead has been qualified and check if a new contact have been created
| } | ||
|
|
||
| [TestMethod] | ||
| public void TestQualifyLeadRequestSuccess() |
There was a problem hiding this comment.
Missing assert if the lead has been qualified
| } | ||
|
|
||
| [TestMethod] | ||
| public void TestQualifyLeadRequestCreateAllSuccess() |
There was a problem hiding this comment.
Missing assert that lead has been qualified and that a new Opportunity and Account have been created and that the opportunity points the the new account and existing contact
|
|
||
| if (request.CreateContact) | ||
| { | ||
| var contactAlreadyExists = db["contact"].Any(row => row["fullname"] != null && row["fullname"].Equals(lead["fullname"])); |
There was a problem hiding this comment.
I don't think Qualified Lead handles any kind of duplicate detection in CRM.
|
|
||
| if (request.CreateAccount) | ||
| { | ||
| var accountAlreadyExists = db["account"].Any(row => row["name"] != null && row["name"].Equals(lead["fullname"])); |
There was a problem hiding this comment.
I don't think Qualified Lead handles any kind of duplicate detection in CRM.
| throw new FaultException("A record was not created or updated because a duplicate of the current record already exists."); | ||
| } | ||
|
|
||
| var account = new Entity |
There was a problem hiding this comment.
Qualify lead uses some of the fields on the lead when creating the account. Such as the Company text field
| throw new FaultException("A record was not created or updated because a duplicate of the current record already exists."); | ||
| } | ||
|
|
||
| var contact = new Entity |
There was a problem hiding this comment.
Qualify Lead uses fields on the lead when creating the contact such as Contact Name and Job title.
#30