本文整理汇总了C#中MainViewModel.InitWithGuiTypes方法的典型用法代码示例。如果您正苦于以下问题:C# MainViewModel.InitWithGuiTypes方法的具体用法?C# MainViewModel.InitWithGuiTypes怎么用?C# MainViewModel.InitWithGuiTypes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MainViewModel
的用法示例。
在下文中一共展示了MainViewModel.InitWithGuiTypes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShowCommand_WillExecuteChangeTypeCommand_Always
public void ShowCommand_WillExecuteChangeTypeCommand_Always()
{
bool calledChangeTypeCommand = false;
var vm = new MainViewModel();
vm.SetWaitIndicator(new Mock<WaitIndicator>().Object);
vm.InitWithGuiTypes(new List<string>() { "A.a", "B.b", "C.c" });
var spyCommand = new Mock<ICommand>();
spyCommand.Setup(c => c.Execute("A.a")).Callback(() => calledChangeTypeCommand = true);
vm.ChangeTypeCommand = spyCommand.Object;
vm.ListOfSelectedAssemblyTypes[0].ShowCommand.Execute("A.a");
Assert.IsTrue(calledChangeTypeCommand);
}
示例2: ShowCommand_WillCloseWaitIndicator_AfterChangeTypeCommandFinished
public void ShowCommand_WillCloseWaitIndicator_AfterChangeTypeCommandFinished()
{
bool calledWaitIndicatorEnd = false;
var spyWaitIndicator = new Mock<WaitIndicator>();
spyWaitIndicator.Setup(w => w.EndWaiting()).Callback(() => calledWaitIndicatorEnd = true);
var vm = new MainViewModel();
vm.SetWaitIndicator(spyWaitIndicator.Object);
vm.InitWithGuiTypes(new List<string>() { "A.a", "B.b", "C.c" });
var dummyCommand = new Mock<ICommand>();
vm.ChangeTypeCommand = dummyCommand.Object;
vm.ListOfSelectedAssemblyTypes[0].ShowCommand.Execute("A.a");
Assert.IsTrue(calledWaitIndicatorEnd);
}
示例3: ShowCommand_WillDisplayWaitIndicator_Always
public void ShowCommand_WillDisplayWaitIndicator_Always()
{
bool calledWaitIndicatorBegin = false;
var spyWaitIndicator = new Mock<WaitIndicator>();
var dummyAppearance = new Mock<IWaitIndicatorAppearance>();
spyWaitIndicator.Setup(w => w.BeginWaiting(dummyAppearance.Object, 0, 0, 0, 0)).Callback(() => calledWaitIndicatorBegin = true);
var vm = new MainViewModel();
vm.PlayButtonWaitIndicatorAppearance = dummyAppearance.Object;
vm.SetWaitIndicator(spyWaitIndicator.Object);
vm.InitWithGuiTypes(new List<string>() { "A.a", "B.b", "C.c" });
var dummyCommand = new Mock<ICommand>();
vm.ChangeTypeCommand = dummyCommand.Object;
vm.ListOfSelectedAssemblyTypes[0].ShowCommand.Execute("A.a");
Assert.IsTrue(calledWaitIndicatorBegin);
}