public void OnPublishingStatusNotificationTests() { // arrange var vm = new MainViewModel(); Mock.Arrange(() => Deployment.Current.Dispatcher.BeginInvoke((Arg.IsAny<Action>()))).DoInstead<Action>(a => a()); var popupFactory = Mock.Create<PopupFactory>(Behavior.CallOriginal); Mock.Arrange(() => popupFactory.ShowBusy(Arg.IsAny<Status>(), true)).MustBeCalled(); vm.ThePopupFactory = popupFactory; var e = new ValueEventArgs<PublishingStatus>(new PublishingStatus { ProgressCompleted = 90.0, Stage = "Deploying", StatusText = "some additional information" }); // act vm.OnPublishingStatusNotification(null, e); // assert Mock.Assert(popupFactory); }