Skip to content

Conversation

@andyb1979
Copy link

@andyb1979 andyb1979 commented Sep 28, 2022

Very small change to allow get/set of MarketingStatus.

We are populating a CRM after signup from a website and need to set MarketingStatus to subscribed. For our own IntegrationTest purposes I'd like to be able to get MarketingStatus as well

Integration tests need to be added, for example I have two persons, one unsubscribed and one subscribed. This test allows me to get and update the statuses:

[IntegrationTest]
public async Task CanRetrievePersonMarketingStatus()
{
    var pipedrive = Helper.GetAuthenticatedClient();

    // Assume person with Id 123 exists and has status subscribed
    var person = await pipedrive.Person.Get(123);

    Assert.Equal("person123@mycompany.com", person.Email[0].Value);
    Assert.Equal("subscribed", person.MarketingStatus);

    // Assume person with Id 456 exists and has status no_consent
    var person2 = await pipedrive.Person.Get(456);

    Assert.Equal("person456@mycompany.com", person2.Email[0].Value);
    Assert.Equal("no_consent", person2.MarketingStatus);

    // Update person 456 
    var data = person2.ToUpdate();
    Assert.Equal(data.MarketingStatus, "no_consent");
    data.MarketingStatus = "subscribed";

    var person2Updated = await pipedrive.Person.Edit(person2.Id, data);
    Assert.Equal("subscribed", person2Updated.MarketingStatus);
}

Now question how to reset that status for the next test. Personally I'd set it back in teardown or create the person for the test. What do you think?

andyb1979 and others added 7 commits September 28, 2022 18:49
… to get/set this property via PersonsClient.Get() and PersonsClient.Edit()
1) Newtonsoft.Json to 13.0.3
2) Azure.Identity to 1.13.2
3) System.Data.SqlClient to 4.9.0
1) Set Standard Renewal Early Reminder as the default stage
2) Email lead added SourceOriginID and SourceChannel for marketing.
3) Added extra logging
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants