Ejemplo n.º 1
0
        public void TestMethod1()
        {
            var context = new XrmRealContext
            {
                ProxyTypesAssembly   = typeof(UploadEmailAndAttachmentsToSharePoint).Assembly,
                ConnectionStringName = "CRMOnline"
            };

            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
            var executionContext = context.GetDefaultWorkflowContext();

            //Inputs
            var inputs = new Dictionary <string, object>();

            // master var mailId = Guid.Parse("575e588c-4ea2-e911-aa05-000d3a2065c5");
            //0ec946a0-fcf3-e911-a811-000d3a649465

            var mailId  = Guid.Parse("d667072e-dfff-e911-a811-000d3a64905b");
            var mainApp = new Entity("email", mailId);

            //inputs.Add("Application", new Entity("defra_application", mailId).ToEntityReference());

            var result = context.ExecuteCodeActivity <UploadEmailAndAttachmentsToSharePoint>
                             (mainApp, inputs);
        }
Ejemplo n.º 2
0
        public void TestMethod1()
        {
            var context = new XrmRealContext
            {
                ProxyTypesAssembly   = typeof(ApplicationLineCreateWasteParams).Assembly,
                ConnectionStringName = "CRMOnline"
            };

            //appid a-10d29e16-1602-ea11-a811-000d3a44a2a9
            //appline id - aa81c9f8-1402-ea11-a811-000d3a44afcc

            //applineid 54440894-fa06-ea11-a811-000d3a44a8e9
            //appid 911c6fd6-f606-ea11-a811-000d3a44ade8
            var guid1  = Guid.Parse("36ac59f5-d607-ea11-a811-000d3a44a237");
            var target = new Entity("defra_applicationline")
            {
                Id = guid1
            };

            target.Attributes.Add("defra_applicationid", new EntityReference("defra_application", Guid.Parse("e17b2ea0-d607-ea11-a811-000d3a44ade8")));

            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
            var executionContext = context.GetDefaultPluginContext();

            //Execute our plugin against a target that doesn't contains the accountnumber attribute
            //var fakedPlugin = context.ExecutePluginWithTarget(target);
        }
Ejemplo n.º 3
0
        public void Test_For_Registeredcharity_Operator_Name()
        {
            var context = new XrmRealContext
            {
                ProxyTypesAssembly   = typeof(GetAddressBasedOnOperatorType).Assembly,
                ConnectionStringName = "CRMOnline"
            };

            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
            var executionContext = context.GetDefaultWorkflowContext();

            //Inputs
            var inputs = new Dictionary <string, object>();

            inputs.Add("GetContact", new EntityReference("contact", null));
            inputs.Add("GetAccount", new EntityReference("account", new Guid("95F84FA5-F3EF-49C6-AC51-AB307DCF4151")));
            // inputs.Add("GetOperatorType", new OptionSetValue((int)defra_organisation_type.Limitedcompany));


            var partnerId = Guid.Parse("86C561FF-D2A7-E911-AA0A-000D3A2065C5");
            var mainApp   = new Entity("defra_application", partnerId);

            var result = context.ExecuteCodeActivity <GetAddressBasedOnOperatorType>
                             (mainApp, inputs);
        }
Ejemplo n.º 4
0
        public void Should_connect_to_CRM()
        {
            var ctx = new XrmRealContext();
            var ex  = Record.Exception(() => ctx.GetOrganizationService());

            Assert.Null(ex);
        }
Ejemplo n.º 5
0
        public void TestMethod1()
        {
            var context = new XrmRealContext
            {
                ProxyTypesAssembly   = typeof(UpdateSharePointMetadata).Assembly,
                ConnectionStringName = "CRMOnline"
            };

            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
            var executionContext = context.GetDefaultWorkflowContext();

            //Inputs
            var inputs = new Dictionary <string, object>();

            inputs.Add("Parent_Entity_Name", "defra_application");
            inputs.Add("Parent_Lookup_Name", "defra_applicationid");
            inputs.Add("Customer", "customer");
            inputs.Add("SiteDetails", "site");
            inputs.Add("PermitDetails", "permit");

            var ltdCompnayId = Guid.Parse("2DAEA1DC-C2A7-E911-A980-000D3A20838A");
            var mainApp      = new Entity("defra_application", ltdCompnayId);

            var result = context.ExecuteCodeActivity <UpdateSharePointMetadata>
                             (mainApp, inputs);
        }
Ejemplo n.º 6
0
        public void Should_generate_plugin_context_from_a_serialised_profile()
        {
            var ctx = new XrmRealContext();
            //var serialised = @"7R1rc9u48Xt/BavOZHLTo0hKsiQrim5ysdNqGseeyLne3JcrCCwl1CTBgpBt+dcX4EtPW6RjUTKjGY9tvPeFxWKBBfu/3Huudgs8pMx/X7PqZk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IteYpTOhLwTnFKpzilHyVOaYNeGXExLUN5i4yANB2J6mIHa01qm5qkH7GVOeEncsOP4fbTuKgtn+it9bVdVeZ9pMGhg+/eBHmWA5aS5vWUi1Q8f2dudWTdVoee4AuxVkK0FprcTEigiB/kKchFj4JJCqQfCmZIwGApNqOughQ/7OSv7/72cPbhL4qiIK48HbZajQaE98MRsDuC4YrRO2IBU4Ll9E+LfUZtk+jWajJAkrHc9VBQmXnIeT/i1L9HHE+U8PfPynL9RBZw9He1OP6OMwv//KxEa5hClmznJPsdcv0PomogJlkewH9FAfzHSGlyo9DUaNwM1CvAHMO3IGJzCZpLVcavPm+o3/8nCmLennuWT4nHv1GeegLiooGcen0tW93+MIgRFwiKDcEg3Cj0tdXs/tI2QE6j5Yx+akHLSTmIaNbXlnP7MUljE2RgVI2+tpLXjwY8vxMaYfvKsFW/b5YK+d1tsR5NGTz5GXAJpFynBk9PtL6WVuz/O3agZY0yfAbgyRCZ9wAvGGMkzM6htUoXLRL+wf8B";

            Assert.DoesNotThrow(() => ctx.GetContextFromSerialisedCompressedProfile(serialised));
        }
Ejemplo n.º 7
0
        public void Should_connect_to_CRM_with_given_OrganizationService()
        {
            var ctx = new XrmRealContext();
            var organizationService = ctx.GetOrganizationService();
            var ctx2 = new XrmRealContext(organizationService);

            Assert.Equal(organizationService, ctx2.GetOrganizationService());
        }
 public void Should_not_initialize_records_when_using_a_real_CRM_instance()
 {
     var ctx = new XrmRealContext();
     ctx.Initialize(new List<Entity>
     {
         new Account() { Id = Guid.NewGuid() }
     });
     Assert.Equal(0, ctx.Data.Count);
 }
Ejemplo n.º 9
0
        public void Should_not_initialize_records_when_using_a_real_CRM_instance()
        {
            var ctx = new XrmRealContext();

            ctx.Initialize(new List <Entity>
            {
                new Account {
                    Id = Guid.NewGuid()
                }
            });
            Assert.Equal(0, ctx.Data.Count);
        }
Ejemplo n.º 10
0
        public void Test_Invalid_Not()
        {
            var context = new XrmRealContext
            {
                ProxyTypesAssembly   = typeof(GetWasteCodesGivenApplictaion).Assembly,
                ConnectionStringName = "CRMOnline"
            };

            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
            var executionContext = context.GetDefaultWorkflowContext();

            //Inputs
            var inputs = new Dictionary <string, object>();

            var ltdCompnayId = Guid.Parse("c9a1300d-1cef-e811-a97a-000d3a233e06");

            var mainApp = new Entity("defra_application", ltdCompnayId);

            var result = context.ExecuteCodeActivity <GetWasteCodesGivenApplictaion>
                             (mainApp, inputs);
        }
Ejemplo n.º 11
0
        public void Test_For_Otherorganisationforexampleacluborassociation_Operator_Name()
        {
            var context = new XrmRealContext
            {
                ProxyTypesAssembly   = typeof(GetAddressBasedOnOperatorType).Assembly,
                ConnectionStringName = "CRMOnline"
            };

            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
            var executionContext = context.GetDefaultWorkflowContext();

            //Inputs
            var inputs = new Dictionary <string, object>();


            var partnerId = Guid.Parse("EFBF132B-1EA9-E911-A980-000D3A20838A");
            var mainApp   = new Entity("defra_application", partnerId);

            var result = context.ExecuteCodeActivity <GetAddressBasedOnOperatorType>
                             (mainApp, inputs);
        }
Ejemplo n.º 12
0
        public void Test_valid_Not()
        {
            var context = new XrmRealContext
            {
                ProxyTypesAssembly   = typeof(GetDandRCodesGivenApplication).Assembly,
                ConnectionStringName = "CRMOnline"
            };

            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
            var executionContext = context.GetDefaultWorkflowContext();

            //Inputs
            var inputs = new Dictionary <string, object>();

            var ltdCompnayId = Guid.Parse("3A54B8B0-E31B-EA11-A811-000D3A44A237");

            var mainApp = new Entity("defra_application", ltdCompnayId);

            var result = context.ExecuteCodeActivity <GetDandRCodesGivenApplication>
                             (mainApp, inputs);
        }
Ejemplo n.º 13
0
        public void Test_For_Partner_Operator_Name()
        {
            var context = new XrmRealContext
            {
                ProxyTypesAssembly   = typeof(GetAddressBasedOnOperatorType).Assembly,
                ConnectionStringName = "CRMOnline"
            };

            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
            var executionContext = context.GetDefaultWorkflowContext();

            //Inputs
            var inputs = new Dictionary <string, object>();


            var partnerId = Guid.Parse("86C561FF-D2A7-E911-AA0A-000D3A2065C5");
            var mainApp   = new Entity("defra_application", partnerId);

            var result = context.ExecuteCodeActivity <GetAddressBasedOnOperatorType>
                             (mainApp, inputs);
        }
        public void TestMethod1()
        {
            var context = new XrmRealContext
            {
                ProxyTypesAssembly   = typeof(GenerateApplicationTasksGivenTaskType).Assembly,
                ConnectionStringName = "CRMOnline"
            };

            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
            var executionContext = context.GetDefaultWorkflowContext();

            //Inputs
            var inputs = new Dictionary <string, object>();

            inputs.Add("Application", new EntityReference("defra_application", new Guid("ca31d9a8-9dc1-e811-a96a-000d3a23443b")));
            inputs.Add("TaskType1", new EntityReference("defra_tasktype", new Guid("f949cc52-6221-e911-a98d-000d3ab311f1")));
            inputs.Add("TaskType2", new EntityReference("defra_tasktype", new Guid("63987ec8-33ef-e811-a988-000d3ab31f97")));


            var result = context.ExecuteCodeActivity <GenerateApplicationTasksGivenTaskType>
                             (inputs);
        }
Ejemplo n.º 15
0
        public void Initialize()
        {
            //Initialize the Context with Admin Account
            context = new XrmRealContext("Xrm");

            //To Run the Plugin with User Context, Add a new ConnectionString and Pass the connectionStringName
            //context = new XrmRealContext("Xrm_Officer");
            //context = new XrmRealContext("Xrm_Manager");

            organizationService = context.GetOrganizationService();

            //Use this method to arrange the required data.
            Entity entity = new Entity("account");

            entity["name"] = "Fourth Coffee Pvt. Ltd";
            Guid accountId = organizationService.Create(entity);

            parameters.Add("Account", entity);
            parameters.Add("AccountId", accountId);

            deleteObjects.Add("account", accountId);
        }
Ejemplo n.º 16
0
        public void TestMethod1()
        {
            var context = new XrmRealContext
            {
                ProxyTypesAssembly   = typeof(CreateDiscountLines).Assembly,
                ConnectionStringName = "CRMOnline"
            };

            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
            var executionContext = context.GetDefaultWorkflowContext();

            //Inputs
            var inputs = new Dictionary <string, object>();


            //9569808e-fd09-ea11-a811-000d3a649fc7

            var soleId  = Guid.Parse("2653dedd-8316-ea11-a811-000d3a44a2a9");
            var mainApp = new Entity("defra_application", soleId);

            var result = context.ExecuteCodeActivity <CreateDiscountLines>
                             (mainApp, inputs);
        }
        public void Test_With_Valid_Application()
        {
            var context = new XrmRealContext
            {
                ProxyTypesAssembly   = typeof(GetValidPermitApplication).Assembly,
                ConnectionStringName = "CRMOnline"
            };

            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
            var executionContext = context.GetDefaultWorkflowContext();

            //Inputs
            var inputs = new Dictionary <string, object>();

            inputs.Add("GetPermit", new EntityReference("defra_permit", new Guid("DE129E7E-ECB1-E911-A98A-000D3A233E06")));

            var application = Guid.Parse("92622D64-FEB1-E911-A98A-000D3A233E06");

            var mainApp = new Entity("defra_application", application);

            var result = context.ExecuteCodeActivity <GetValidPermitApplication>
                             (mainApp, inputs); //
        }
Ejemplo n.º 18
0
        public void TestMethod_When_Bespoke_Application_Is_NULL()
        {
            var context = new XrmRealContext
            {
                ProxyTypesAssembly   = typeof(GetPermitDetails).Assembly,
                ConnectionStringName = "CRMOnline"
            };

            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
            var executionContext = context.GetDefaultWorkflowContext();

            //Inputs
            var inputs = new Dictionary <string, object>();

            inputs.Add("Application", null);
            inputs.Add("Permit", new EntityReference("defra_permit", Guid.Parse("937f3266-db4c-ea11-a812-000d3a44ade8")));
            //9569808e-fd09-ea11-a811-000d3a649fc7

            var soleId  = Guid.Parse("7801c90f-3b15-ea11-a811-000d3a44a237");
            var mainApp = new Entity("defra_application", soleId);

            var result = context.ExecuteCodeActivity <GetPermitDetails>
                             (mainApp, inputs);
        }
Ejemplo n.º 19
0
        public void TestMethod_When_bespoke()
        {
            var context = new XrmRealContext
            {
                ProxyTypesAssembly   = typeof(GetPermitDetails).Assembly,
                ConnectionStringName = "CRMOnline"
            };

            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
            var executionContext = context.GetDefaultWorkflowContext();

            //Inputs
            var inputs = new Dictionary <string, object>();

            inputs.Add("Application", new EntityReference("defra_application", Guid.Parse("67810b75-b420-ea11-a810-000d3a44a237")));
            inputs.Add("Permit", new EntityReference("defra_permit", null));
            //9569808e-fd09-ea11-a811-000d3a649fc7

            var soleId  = Guid.Parse("D8307C83-940B-EA11-A811-000D3ABAC0B9");
            var mainApp = new Entity("defra_application", soleId);

            var result = context.ExecuteCodeActivity <GetPermitDetails>
                             (mainApp, inputs);
        }
Ejemplo n.º 20
0
        public void TestMethod1()
        {
            var context = new XrmRealContext
            {
                ProxyTypesAssembly   = typeof(ApplicationCreateFolderInSharePoint).Assembly,
                ConnectionStringName = "CRMOnline"
            };

            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
            var executionContext = context.GetDefaultWorkflowContext();

            //Inputs
            var inputs = new Dictionary <string, object>();



            var ltdCompnayId = Guid.Parse("2DAEA1DC-C2A7-E911-A980-000D3A20838A");
            var mainApp      = new Entity("defra_application", ltdCompnayId);

            inputs.Add("Application", new Entity("defra_application", ltdCompnayId).ToEntityReference());

            var result = context.ExecuteCodeActivity <ApplicationCreateFolderInSharePoint>
                             (mainApp, inputs);
        }
        public void TestMethod1()
        {
            var context = new XrmRealContext
            {
                ProxyTypesAssembly   = typeof(DeleteApplicationLinesGivenLineType).Assembly,
                ConnectionStringName = "CRMOnline"
            };

            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
            var executionContext = context.GetDefaultWorkflowContext();

            //Inputs
            var inputs = new Dictionary <string, object>();

            inputs.Add("GetLineType", 910400003);

            //9569808e-fd09-ea11-a811-000d3a649fc7

            var soleId  = Guid.Parse("a99288d1-9407-ea11-a811-000d3a44a237");
            var mainApp = new Entity("defra_application", soleId);

            var result = context.ExecuteCodeActivity <DeleteApplicationLinesGivenLineType>
                             (mainApp, inputs);
        }
 public void Should_connect_to_CRM()
 {
     var ctx = new XrmRealContext();
     Assert.DoesNotThrow(() => ctx.GetOrganizationService());
 }
Ejemplo n.º 23
0
        public void Should_connect_to_CRM_with_given_ConnectionString()
        {
            var ctx = new XrmRealContext("myfirstconnectionstring");

            Assert.Equal("myfirstconnectionstring", ctx.ConnectionStringName);
        }
Ejemplo n.º 24
0
        public void Should_connect_to_CRM()
        {
            var ctx = new XrmRealContext();

            Assert.DoesNotThrow(() => ctx.GetOrganizationService());
        }