Beispiel #1
0
        private void BtnCreateComment_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                commentCtrl.CreateComment(@case.Id, SupporterController.LoggedInSupporter, txtNewComment.Text);

                FillComments();

                txtNewComment.Clear();
            }
            catch (Exception ex)
            {
                ((MainWindow)Application.Current.MainWindow).SetStatus(ex.Message);
            }
        }
        public void CreateComment_Returns201Created_WhenValidObjectSubmitted()
        {
            //Arrange
            iCommentService.Setup(serv =>
                                  serv.GetCommentById(1)).Returns(new Comment {
                CommentId = 1, Description = "Mock", Date = new DateTime(), EventId = 1
            });

            var controller = new CommentController(iCommentService.Object, mapper);

            //Act
            var result = controller.CreateComment(new CommentCreateDTO {
            });

            //Assert
            Assert.IsType <CreatedAtRouteResult>(result.Result);
        }
        public void CreateComment()
        {
            var retorno = commentController.CreateComment(commentOne.Message);

            Assert.IsType <OkObjectResult>(retorno);
        }