本文整理汇总了C#中MainViewModel.HandleEvent方法的典型用法代码示例。如果您正苦于以下问题:C# MainViewModel.HandleEvent方法的具体用法?C# MainViewModel.HandleEvent怎么用?C# MainViewModel.HandleEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MainViewModel
的用法示例。
在下文中一共展示了MainViewModel.HandleEvent方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleEvent_WhenReminderClicked_ShowsPopupConfirmation
public void HandleEvent_WhenReminderClicked_ShowsPopupConfirmation()
{
//Arrange
var vm = new MainViewModel { IsBusy = true };
var popupMock = PopupMock.Create();
popupMock.ConfirmMustBeCalled();
vm.ThePopupFactory = popupMock.ThePopupFactory;
//Act
vm.HandleEvent(new NeedToIncreaseQuotaEvent(0));
var reminder = vm.Reminders[0];
reminder.ClickCommand.Execute(null);
//Assert
popupMock.AssertConfirmCalled();
}
示例2: HandleEvent_WhenPassedGlobalSearchStartedEvent_SetsStatusNotBusy
public void HandleEvent_WhenPassedGlobalSearchStartedEvent_SetsStatusNotBusy()
{
//Arrange
var vm = new MainViewModel { IsBusy = true };
//Act
vm.HandleEvent(new GlobalSearchStartedEvent(true));
//Assert
Assert.IsTrue(vm.IsSearching);
}
示例3: HandleEvent_WhenPassedNeedToIncreaseQuotaEvent_AddsReminder
public void HandleEvent_WhenPassedNeedToIncreaseQuotaEvent_AddsReminder()
{
//Arrange
var vm = new MainViewModel { IsBusy = true };
//Act
vm.HandleEvent(new NeedToIncreaseQuotaEvent(0));
//Assert
Assert.IsTrue(vm.Reminders.Count == 1);
}
示例4: HandleEvent_WhenPassedLibraryDownloadEvent_SetsStatusNotBusy
public void HandleEvent_WhenPassedLibraryDownloadEvent_SetsStatusNotBusy()
{
//Arrange
var vm = new MainViewModel { IsBusy = true };
vm.ThePopupFactory = Mock.Create<PopupFactory>();
//Act
vm.HandleEvent(new LibraryDownloadEvent(LibraryTypes.Custom));
//Assert
vm.IsBusy = false;
}