Exemplo n.º 1
0
        public async Task <IHttpActionResult> GetWallList(WallsListFilter filter)
        {
            var wallList = await _wallService.GetWallsListAsync(GetUserAndOrganization(), filter);

            var mappedWallList = _mapper.Map <IEnumerable <WallDto>, IEnumerable <WallListViewModel> >(wallList);

            return(Ok(mappedWallList));
        }
        public async Task Wall_GetWall_List_Should_Return_View_Model()
        {
            IEnumerable <WallDto> walls = new List <WallDto>
            {
                new WallDto
                {
                    Id          = 0,
                    Description = "Description",
                    IsFollowing = false
                },
                new WallDto
                {
                    Id          = 1,
                    Description = "Description",
                    IsFollowing = false
                }
            };

            _wallService.GetWallsListAsync(null, WallsListFilter.All).ReturnsForAnyArgs(Task.Run(() => walls));

            var response = await _wallController.GetWallList(WallsListFilter.All);

            Assert.IsInstanceOf <OkNegotiatedContentResult <IEnumerable <WallListViewModel> > >(response);
        }