Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }