コード例 #1
0
        public void UpsertExistingTest()
        {
            var existingGuid = Guid.Parse("00000000-0ed7-e811-a30f-0050568a2d1a");
            var fakedContext = new XrmFakedContext();
            var newContact   = new Entity("contact", existingGuid);

            newContact["fullname"] = "Malachy O'Connor";

            fakedContext.Initialize(new List <Entity>()
            {
                newContact
            });

            //Read sample file
            IOrganizationService organisationService = fakedContext.GetOrganizationService();

            //Update Data
            DataImportManager importer = new DataImportManager(organisationService, new TestLogger());
            var result = importer.ImportFile(@"..\..\..\Xrm.Framework.CI.Extensions\Schema\CRUD.sample.json");

            //Retrieve upserted record
            Entity updatedContact = organisationService.Retrieve("contact", existingGuid, new ColumnSet(true));

            Assert.Equal("Adrian Test", updatedContact["fullname"]);
        }
コード例 #2
0
 public void CrudIntegrationTest()
 {
     //Read sample file
     IOrganizationService organisationService = new TestConnectionManager().CreateConnection();
     DataImportManager    importer            = new DataImportManager(organisationService, new TestLogger());
     var result = importer.ImportFile(@"..\..\..\Xrm.Framework.CI.Extensions\Schema\CRUD.sample.json");
 }