public void CreatePhoneCallForNewLeadPassTelephone1() { var lead = _testDataService.GetRepository <ILeadTestDataRepo>().GetPhoneCall(); lead.FirstName = DateTime.Now.ToShortDateString() + DateTime.Now.Date.ToShortTimeString(); lead.Attributes.Remove(nameof(lead.MobilePhone).ToLower()); lead.Id = CrmTestDataService.CreateTestEntity(lead); var partyAndPointer = CrmDataServiceAf.GetRepository <IActivityPointerCrmRepo>().GetAcPartyAndPointer(lead.Id); if (partyAndPointer.pointer?.ActivityId != null) { CrmTestDataService.AddTestEntityToDelete(new EntityReference(partyAndPointer.pointer.ActivityTypeCode, partyAndPointer.pointer.ActivityId.Value)); } Assert.IsNotNull(partyAndPointer.pointer?.ActivityId); var phoneCallFromCrm = CrmDataServiceAf.GetEntities <PhoneCall>(o => o.ActivityId == partyAndPointer.pointer.ActivityId, o => new PhoneCall { PhoneNumber = o.PhoneNumber }).FirstOrDefault(); Assert.AreEqual(phoneCallFromCrm?.PhoneNumber, lead.Telephone1); }
public void CreatePhoneCallForNewLeadPassNoFullName() { var lead = _testDataService.GetRepository <ILeadTestDataRepo>().GetPhoneCall(); lead.FirstName = DateTime.Now.ToShortDateString() + DateTime.Now.Date.ToShortTimeString(); lead.Attributes.Remove(nameof(lead.FirstName).ToLower()); lead.Attributes.Remove(nameof(lead.LastName).ToLower()); lead.Id = CrmTestDataService.CreateTestEntity(lead); var partyAndPointer = CrmDataServiceAf.GetRepository <IActivityPointerCrmRepo>().GetAcPartyAndPointer(lead.Id); Assert.IsNull(partyAndPointer.pointer?.ActivityId); }
public void CreatePhoneCallForNewLeadPassNoPhone() { var lead = _testDataService.GetRepository <ILeadTestDataRepo>().GetPhoneCall(); lead.FirstName = DateTime.Now.ToShortDateString() + DateTime.Now.Date.ToShortTimeString(); lead.Attributes.Remove(nameof(lead.MobilePhone).ToLower()); lead.Attributes.Remove(nameof(lead.Telephone1).ToLower()); lead.Id = CrmTestDataService.CreateTestEntity(lead); var partyAndPointer = CrmDataServiceAf.GetRepository <IActivityPointerCrmRepo>().GetAcPartyAndPointer(lead.Id); if (partyAndPointer.pointer?.ActivityId != null) { CrmTestDataService.AddTestEntityToDelete(new EntityReference(partyAndPointer.pointer.ActivityTypeCode, partyAndPointer.pointer.ActivityId.Value)); } Assert.IsNull(partyAndPointer.pointer?.ActivityId); }