本文整理汇总了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]);
}
示例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]);
}
示例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]);
}
示例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]);
}