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


C# CommandSet.Invoke方法代码示例

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


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

示例1: From_complex_un_sortId_and_dependy

        public void From_complex_un_sortId_and_dependy()
        {
            var actual = new List<string>();
            var commands = new List<ICommand>
            {
                new CommandMock(actual)
                {
                    Setting = new SettingMock
                    {
                        Id = "1"
                    }
                },
                new CommandMock(actual)
                {
                    Setting = new SettingMock
                    {
                        Id = "2",
                    }
                },
                new CommandMock(actual)
                {
                    Setting = new SettingMock
                    {
                        Id = "1-1",
                        Dependency="1"
                    }
                },
                 new CommandMock(actual)
                {
                    Setting = new SettingMock
                    {
                        Id = "3"
                    }
                },
                new CommandMock(actual)
                {
                    Setting = new SettingMock
                    {
                        Id = "1-1-1",
                        Dependency="1-1"
                    }
                },
                new CommandMock(actual)
                {
                    Setting = new SettingMock
                    {
                        Id = "1-2",
                        Dependency="1"
                    }
                }
            };
            var st = new CommandSet(new ExecuteSetting("./"), commands);
            st.Skip.Add("1");
            st.Invoke();

            Assert.AreEqual(2, actual.Count);

            Assert.AreEqual("2", actual[0]);
            Assert.AreEqual("3", actual[1]);
        }
开发者ID:luqizheng,项目名称:lb_releaseIt,代码行数:60,代码来源:UnitTest_CommandSet.cs

示例2: From_Run_Auto_Step

        public void From_Run_Auto_Step()
        {
            var result = new List<string>();
            var commands = new List<ICommand>
            {
                new CommandMock(result)
                {
                    Setting = new SettingMock
                    {
                        Id = "1"
                    }
                },
                new CommandMock(result)
                {
                    Setting = new SettingMock
                    {
                        Id = "2",
                        Dependency="1"
                    }
                },
                new CommandMock(result)
                {
                    Setting = new SettingMock
                    {
                        Dependency = "2",
                        Id = "3"
                    }
                }
            };
            var st = new CommandSet(new ExecuteSetting("./"), commands);

            st.Include.Add("3");
            st.Invoke();

            Assert.AreEqual(result.Count, 3);
            Assert.AreEqual("1", result[0]);
            Assert.AreEqual("2", result[1]);
            Assert.AreEqual("3", result[2]);
        }
开发者ID:luqizheng,项目名称:lb_releaseIt,代码行数:39,代码来源:UnitTest_CommandSet.cs

示例3: Test_Tags_Order

        public void Test_Tags_Order()
        {
            var actual = new List<string>();
            var commands = new List<ICommand>
            {
                new CommandMock(actual)
                {
                    Setting = new SettingMock
                    {
                        Id = "1",
                        Tags = new[]
                        {
                            "Run"
                        }
                    }
                },
                new CommandMock(actual)
                {
                    Setting = new SettingMock
                    {
                        Id = "2",
                    }
                },
                new CommandMock(actual)
                {
                    Setting = new SettingMock
                    {
                        Id = "3",
                          Tags = new[]
                        {
                            "Run"
                        }
                    }
                }
            };
            var st = new CommandSet(new ExecuteSetting("./"), commands);
            st.IncludeTags.Add("Run");
            st.Invoke();

            Assert.AreEqual(2, actual.Count);

            Assert.AreEqual("1", actual[0]);
            Assert.AreEqual("3", actual[1]);
        }
开发者ID:luqizheng,项目名称:lb_releaseIt,代码行数:44,代码来源:UnitTest_CommandSet.cs

示例4: From_Skip_step

        public void From_Skip_step()
        {
            var actual = new List<string>();
            var commands = new List<ICommand>
            {
                new CommandMock(actual)
                {
                    Setting = new SettingMock
                    {
                        Id = "1"
                    }
                },
                new CommandMock(actual)
                {
                    Setting = new SettingMock
                    {
                        Id = "2",
                    }
                },
                new CommandMock(actual)
                {
                    Setting = new SettingMock
                    {
                        Id = "3"
                    }
                }
            };
            var st = new CommandSet(new ExecuteSetting("./"), commands);
            st.Skip.Add("1");
            st.Invoke();

            Assert.AreEqual(2, actual.Count);

            Assert.AreEqual("2", actual[0]);
            Assert.AreEqual("3", actual[1]);
        }
开发者ID:luqizheng,项目名称:lb_releaseIt,代码行数:36,代码来源:UnitTest_CommandSet.cs


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