当前位置: 首页>>代码示例>>C#>>正文


C# XrmFakedContext.ExecutePluginWithTarget方法代码示例

本文整理汇总了C#中FakeXrmEasy.XrmFakedContext.ExecutePluginWithTarget方法的典型用法代码示例。如果您正苦于以下问题:C# XrmFakedContext.ExecutePluginWithTarget方法的具体用法?C# XrmFakedContext.ExecutePluginWithTarget怎么用?C# XrmFakedContext.ExecutePluginWithTarget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FakeXrmEasy.XrmFakedContext的用法示例。


在下文中一共展示了XrmFakedContext.ExecutePluginWithTarget方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: XrmFakedContext

        public void When_the_account_number_plugin_is_executed_for_an_account_that_already_has_a_number_exception_is_thrown()
        {
            var fakedContext = new XrmFakedContext();

            var guid1 = Guid.NewGuid();
            var target = new Entity("account") { Id = guid1 };
            target["accountnumber"] = 69;

            //Execute our plugin against a target thatcontains the accountnumber attribute will throw exception
            Assert.Throws<InvalidPluginExecutionException>(() => fakedContext.ExecutePluginWithTarget<AccountNumberPlugin>(target));

        }
开发者ID:ccellar,项目名称:fake-xrm-easy,代码行数:12,代码来源:FakeContextTestPlugins.cs

示例2: When_the_account_number_plugin_is_executed_it_adds_a_random_number_to_an_account_entity

        public void When_the_account_number_plugin_is_executed_it_adds_a_random_number_to_an_account_entity()
        {
            var fakedContext = new XrmFakedContext();

            var guid1 = Guid.NewGuid();
            var target = new Entity("account") { Id = guid1 };

            //Execute our plugin against a target that doesn't contains the accountnumber attribute
            var fakedPlugin = fakedContext.ExecutePluginWithTarget<AccountNumberPlugin>(target);

            //Assert that the target contains a new attribute      
            Assert.True(target.Attributes.ContainsKey("accountnumber"));

        }
开发者ID:ccellar,项目名称:fake-xrm-easy,代码行数:14,代码来源:FakeContextTestPlugins.cs

示例3: When_a_plugin_with_target_is_executed_the_inherent_plugin_was_also_executed_without_exceptions

        public void When_a_plugin_with_target_is_executed_the_inherent_plugin_was_also_executed_without_exceptions()
        {
            var fakedContext = new XrmFakedContext();

            var guid1 = Guid.NewGuid();
            var target = new Entity("contact") { Id = guid1 };

            //Execute our plugin against the selected target
            var fakedPlugin = fakedContext.ExecutePluginWithTarget<RetrieveServicesPlugin>(target);

            //Assert that the plugin was executed      
            A.CallTo(() => fakedPlugin.Execute(A<IServiceProvider>._))
                .MustHaveHappened();

        }
开发者ID:ccellar,项目名称:fake-xrm-easy,代码行数:15,代码来源:FakeContextTestPlugins.cs

示例4: When_the_followup_plugin_is_executed_for_an_account_it_should_create_a_new_task

        public void When_the_followup_plugin_is_executed_for_an_account_it_should_create_a_new_task()
        {
            var fakedContext = new XrmFakedContext();
            fakedContext.ProxyTypesAssembly = Assembly.GetExecutingAssembly(); //Needed to be able to return early bound entities

            var guid1 = Guid.NewGuid();
            var target = new Entity("account") { Id = guid1 };

            fakedContext.ExecutePluginWithTarget<FollowupPlugin>(target);

            //The plugin creates a followup activity, check that that one exists
            var tasks = (from t in fakedContext.CreateQuery<Task>()
                         select t).ToList();

            Assert.True(tasks.Count == 1);
            Assert.True(tasks[0]["subject"].Equals("Send e-mail to the new customer."));
        }
开发者ID:ccellar,项目名称:fake-xrm-easy,代码行数:17,代码来源:FakeContextTestPlugins.cs

示例5: When_executing_a_plugin_which_inherits_from_iplugin_it_does_compile

 public void When_executing_a_plugin_which_inherits_from_iplugin_it_does_compile()
 {
     var fakedContext = new XrmFakedContext();
     var fakedPlugin = fakedContext.ExecutePluginWithTarget<MyPlugin>(new Entity());
 }
开发者ID:ccellar,项目名称:fake-xrm-easy,代码行数:5,代码来源:FakeContextTestPlugins.cs


注:本文中的FakeXrmEasy.XrmFakedContext.ExecutePluginWithTarget方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。