Exemplo n.º 1
0
        public IActionResult Post([FromBody] RatingAddViewModel ratingAddViewModel)
        {
            ratingAddViewModel.UserId = Convert.ToInt32(User.Identity.Name);
            _ratingService.Add(ratingAddViewModel);

            return(StatusCode(StatusCodes.Status200OK));
        }
Exemplo n.º 2
0
        public async Task rating_service_add_should_succeed()
        {
            var ratingAddViewModel = new RatingAddViewModel
            {
                UserId = 1,
                GameId = 1,
                Value  = 1
            };

            _ratingService.Add(ratingAddViewModel);
            _autoMapperMock.Verify(x => x.Map <CreateRatingCommand>(ratingAddViewModel), Times.Once);
            _mediatorBusMock.Verify(x => x.SendCommand(It.IsAny <CreateRatingCommand>()), Times.Once);
        }
Exemplo n.º 3
0
        public void Add(RatingAddViewModel ratingAddViewModel)
        {
            var createRatingCommand = _mapper.Map <CreateRatingCommand>(ratingAddViewModel);

            _bus.SendCommand(createRatingCommand);
        }