void ShouldNotifyIfAlreadyWorkingWith() { HelpNotification Notification = new HelpNotification(PinkUser, HelpNotificationStatus.AskForHelp, "1"); Messenger.Default.Send(Notification, "BlueUser_PostNotification"); _viewModel.NotifyUser.Execute(PinkUser); Assert.NotNull(_viewModel.Overlay); Assert.Equal("You are already working with", _viewModel.Overlay.MessageOne); }
void ShouldAcceptRequestForHelp() { HelpNotification Notification = new HelpNotification(PinkUser, HelpNotificationStatus.AskForHelp, "1"); Messenger.Default.Send(Notification, "BlueUser_PostNotification"); Assert.NotNull(_viewModel.NotificationPanel); _viewModel.AcceptGalaxy.Execute(null); Assert.Equal(_viewModel.UserHelping, PinkUser); Assert.Null(_viewModel.NotificationPanel); }
void ShouldClearRequestsWhenDecliningGalaxies() { HelpNotification Notification = new HelpNotification(PinkUser, HelpNotificationStatus.AskForHelp); Messenger.Default.Send(Notification, "BlueUser_PostNotification"); Assert.NotNull(_viewModel.NotificationPanel); _viewModel.DeclineGalaxy.Execute(null); Assert.Empty(_viewModel.PendingRequests); Assert.Null(_viewModel.NotificationPanel); }
void ShouldNotifyIfPendingRequest() { PurpleUser.Active = true; _viewModel.OnSubjectStatusChange(true); HelpNotification Notification = new HelpNotification(PinkUser, HelpNotificationStatus.AskForHelp, "1"); Messenger.Default.Send(Notification, "BlueUser_PostNotification"); _viewModel.NotifyUser.Execute(PurpleUser); Assert.NotNull(_viewModel.Overlay); Assert.Equal("You must respond to your current help request.", _viewModel.Overlay.MessageOne); }
void ShouldNotifyWhenUserIsLeaving() { HelpNotification Notification = new HelpNotification(PinkUser, HelpNotificationStatus.AskForHelp); Messenger.Default.Send(Notification, "BlueUser_PostNotification"); HelpNotification LeavingNotification = new HelpNotification(PinkUser, HelpNotificationStatus.Leaving); Messenger.Default.Send(LeavingNotification, "UserLeaving"); Assert.NotNull(_viewModel.Overlay); Assert.Equal("Sorry,", _viewModel.Overlay.MessageOne); Assert.Equal("has left the table.", _viewModel.Overlay.MessageTwo); }
void ShouldWarnAcceptingInviteClearsGalaxy() { _viewModel.OnSubjectStatusChange(true); HelpNotification Notification = new HelpNotification(PinkUser, HelpNotificationStatus.AskForHelp, "1"); Messenger.Default.Send(Notification, "BlueUser_PostNotification"); Assert.NotNull(_viewModel.NotificationPanel); _viewModel.AcceptGalaxy.Execute(null); Assert.NotNull(_viewModel.NotificationPanel); Assert.Equal(NotificationPanelStatus.ShowWarning, _viewModel.NotificationPanel.Status); _viewModel.AcceptGalaxy.Execute(null); Assert.Null(_viewModel.NotificationPanel); }
void ShouldNotifyIfAlreadyAsked() { PinkUser.Active = true; _viewModel.OnSubjectStatusChange(true); _viewModel.NotifyUser.Execute(PinkUser); Assert.Null(_viewModel.Overlay); HelpNotification Notification = new HelpNotification(PinkUser, HelpNotificationStatus.Decline); Messenger.Default.Send(Notification, "BlueUser_PostNotification"); _viewModel.NotifyUser.Execute(PinkUser); Assert.NotNull(_viewModel.Overlay); Assert.Equal("Sorry, you have already asked", _viewModel.Overlay.MessageOne); Assert.Equal("for help.", _viewModel.Overlay.MessageTwo); }