예제 #1
0
        public async Task GetEventListAsync_LoadEventThenMapTheResponse()
        {
            const int groupId        = 8;
            var       events         = new List <Event>();
            var       eventsResponse = new List <EventResponse>();

            _eventService.GetEventsForGroupAsync(_executionContext, groupId)
            .Returns(events);
            _mapper.Map <List <EventResponse> >(events)
            .Returns(eventsResponse);

            var result = await _controller.GetEventListAsync(_executionContext, groupId);

            result.Value.Should().BeSameAs(eventsResponse);
        }