Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }
Example #4
0
        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);
        }
Example #5
0
        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);
        }
Example #6
0
        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);
        }
Example #7
0
        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);
        }