Ejemplo n.º 1
0
        public void Update_StateUnderTest_ExpectedBehavior()
        {
            // Arrange
            var boardController    = this.CreateBoardController();
            BoardUpdateInput input = null;

            // Act
            var result = boardController.Update(
                input);

            // Assert
            Assert.True(false);
            this.mockRepository.VerifyAll();
        }
Ejemplo n.º 2
0
        public ActionResult <BoardUpdateOutput> Update(BoardUpdateInput input)
        {
            UpdateBoardCommand command = _mapper.Map <BoardUpdateInput, UpdateBoardCommand>(input);

            Task <UpdateBoardCommandResult> result = _boardService.Update(command);

            BoardUpdateOutput returnValue = _mapper.Map <UpdateBoardCommandResultItem, BoardUpdateOutput>(result.Result.ResultObject.Data);

            foreach (var item in result.Result.ResultObject.GetErrorMessageList())
            {
                returnValue.MessageList.Add(item.UserFriendlyText);
            }

            if (result.Result.ResultObject.Success)
            {
                returnValue.IsSuccess = true;
                return(Ok(returnValue));
            }
            else
            {
                returnValue.IsSuccess = false;
                return(BadRequest(returnValue));
            }
        }