public async Task <GetBusinessItemDetailsResponse> GetBusinessItemDetails(GetBusinessItemDetailsRequest request)
        {
            var businessRuleResponse =
                _validateBusinessItemsDetailsBusinessRules
                .Validate(new ValidateBusinessItemsDetailsBusinessRulesRequest(request.Id, request.StartDate, request.EndDate));

            if (!businessRuleResponse.IsSuccess)
            {
                return(GetBusinessItemDetailsResponse.Failed(businessRuleResponse.ErrorMessages));
            }

            var response =
                await _getParliamentEventDetails.GetParliamentEventDetails(
                    new GetParliamentEventDetailsRequest(_getParliamentEventDetailsSettings.EndPoint, request.Id, request.StartDate, request.EndDate));

            return(GetBusinessItemDetailsResponse.Success(
                       new BusinessItemDetailsModel(
                           response.BusinessItemDetails.Id,
                           response.BusinessItemDetails.StartDate.ToLongDateString(),
                           response.BusinessItemDetails.StartTime,
                           response.BusinessItemDetails.EndDate.ToLongDateString(),
                           response.BusinessItemDetails.EndTime,
                           response.BusinessItemDetails.Description,
                           response.BusinessItemDetails.Category,
                           response.BusinessItemDetails.Members.Any()
                        ? response.BusinessItemDetails.Members.Select(memberItem => new MemberItemViewModel(memberItem.Id, memberItem.Name))
                        : new List <MemberItemViewModel>())));
        }
        public async Task Return_business_item_details()
        {
            // arrange
            var dummyDescription = "dummy description";
            var dummyCategory    = "dummy category";

            var memberId        = 1;
            var dummyMemberName = "dummy member name";

            var members =
                new List <MemberItem>
            {
                new MemberItem(memberId, dummyMemberName)
            };

            var startTime = "dummy start time";
            var endTime   = "dummy end time";

            var model = new BusinessItemDetails(_eventId, _startDate, startTime, _endDate, endTime, dummyDescription, dummyCategory, members);

            _stubGetParliamentEventDetails
            .GetParliamentEventDetails(
                Arg.Is <GetParliamentEventDetailsRequest>(request =>
                                                          request.Url == _dummyEventDetailsEndpoint &&
                                                          request.StartDate == _startDate &&
                                                          request.EndDate == _endDate &&
                                                          request.Id == _eventId))
            .Returns(GetParliamentEventDetailsResponse.Success(model));

            var sut = new GetBusinessItemDetailsController(new GetBusinessItemDetailsService(_stubGetParliamentEventDetailsSettings, _stubGetParliamentEventDetails, _businessItemsDetailsBusinessRules));

            // act
            var result =
                await sut.GetDetails(
                    _eventId,
                    new GetBusinessItemDetailsQuery
            {
                EndDate   = _endDate,
                StartDate = _startDate
            });

            // assert
            Assert.That(result, Is.TypeOf <OkObjectResult>());

            var response = (BusinessItemDetailsModel)((OkObjectResult)result).Value;

            Assert.That(response.StartTime, Is.EqualTo(startTime));
            Assert.That(response.StartDate, Is.EqualTo(_startDate.ToLongDateString()));
            Assert.That(response.EndTime, Is.EqualTo(endTime));
            Assert.That(response.EndDate, Is.EqualTo(_endDate.ToLongDateString()));
            Assert.That(response.Description, Is.EqualTo(dummyDescription));
            Assert.That(response.Category, Is.EqualTo(dummyCategory));
            Assert.That(response.Members.ElementAt(0).Id, Is.EqualTo(memberId));
            Assert.That(response.Members.ElementAt(0).Name, Is.EqualTo(dummyMemberName));
        }