Beispiel #1
0
 private void Send(string email)
 {
     try
     {
         FeedbackSender.Send(email, content, emailTitle, Application.unityVersion, InAudio.CurrentVersion);
         send = SendingStatus.Send;
     }
     catch (Exception)
     {
         send = SendingStatus.Error;
     }
 }
            public async Task ReturnError_WhenInvalidPlayerFeedbackIsGiven()
            {
                var invalidFeedback = _playerFeedback with {
                    Rating = 7
                };

                var feedbackSender = new FeedbackSender(_mockMessageSender.Object);

                var result = await feedbackSender.Send(invalidFeedback);

                Assert.True(result.IsError);
            }
        }
            public async Task ReturnOk_WhenValidPlayerFeedbackIsGiven()
            {
                var addPlayerFeedbackMessage = new AddPlayerFeedbackMessage
                {
                    SessionId = _playerFeedback.SessionId,
                    PlayerId  = _playerFeedback.PlayerId,
                    Rating    = _playerFeedback.Rating,
                    Comment   = _playerFeedback.Comment,
                    Timestamp = _playerFeedback.Timestamp
                };

                _mockMessageSender
                .Setup(sender => sender.Send(It.IsAny <AddPlayerFeedbackMessage>()))
                .Verifiable();

                var feedbackSender = new FeedbackSender(_mockMessageSender.Object);

                var result = await feedbackSender.Send(_playerFeedback);

                _mockMessageSender.Verify(sender => sender.Send(addPlayerFeedbackMessage));

                Assert.True(result.IsOk);
            }