Beispiel #1
0
        public void PersistAddedTest()
        {
            var contact = new Contact();
            contact.Id = Guid.NewGuid();
            contact.Firstname = "Kate";
            contact.Lastname = "Smith";

            var organisationService = new Microsoft.Xrm.Sdk.Fakes.StubIOrganizationService();
            var crmUnitOfWork = new Xrm.Infrastructure.DataAccess.Crm.Fakes.StubCrmUnitOfWork(organisationService, 10);
            var target = new ContactRepository(organisationService, crmUnitOfWork);

            //
            // Act
            //
            target.PersistAdded(contact);

            //
            // Assert
            //
            Assert.AreEqual(1, crmUnitOfWork.Requests.Count);
        }
Beispiel #2
0
 public void UpdateContact(Contact contact)
 {
     _contactRepository.Update(contact);
     _unitOfWork.Commit();
 }