public async Task TestDeleteObject() { IConnector connector = new Connector(consumerKey, consumerSecret, userName, passwordAndToken, false, log, jsonHttpClient, xmlHttpClient); ISalesforceService salesforceService = new SalesforceService(connector, log); dynamic lead = new ExpandoObject(); using (salesforceService) { lead = await salesforceService.GetObjectByExternalIdentifier("Lead", "Email", "*****@*****.**"); bool isDeleted = await salesforceService.DeleteObject(lead.Id, "Lead"); Assert.IsTrue(isDeleted); } }
public async Task TestUpdateObject() { IConnector connector = new Connector(consumerKey, consumerSecret, userName, passwordAndToken, false, log, jsonHttpClient, xmlHttpClient); ISalesforceService salesforceService = new SalesforceService(connector, log); using (salesforceService) { dynamic lead = await salesforceService.GetObjectByExternalIdentifier("Lead", "Email", "*****@*****.**"); Assert.AreEqual("Fake News Inc.", lead.Company); dynamic updatedLead = new ExpandoObject(); updatedLead.Company = "Fake News Corp."; bool isUpdated = await salesforceService.InsertUpdateObject(updatedLead, "Lead", lead.Id); Assert.IsTrue(isUpdated); } }