public void Then_no_errors_are_triggered_for_a_valid_query_string()
        {
            var requestObject = CollectionCalendarQueryStringParser.ParseQueryString(_queryStringDictionary, out _validationMessage);

            requestObject.Should().NotBeNull();
            _validationMessage.Length.Should().Be(0);
        }
        public void Then_an_error_is_returned_if_active_invalid(string activeValue)
        {
            _queryStringDictionary["Active"] = activeValue;
            var requestObject = CollectionCalendarQueryStringParser.ParseQueryString(_queryStringDictionary, out _validationMessage);

            requestObject.Should().BeNull();
            _validationMessage.Should().Contain("Invalid value for Active");
        }
        public void Then_an_error_is_returned_if_active_missing()
        {
            _queryStringDictionary.Remove("Active");
            var requestObject = CollectionCalendarQueryStringParser.ParseQueryString(_queryStringDictionary, out _validationMessage);

            requestObject.Should().BeNull();
            _validationMessage.Should().Contain("Active not set");
        }
        public void Then_an_error_is_returned_if_period_invalid(string periodValue)
        {
            _queryStringDictionary["PeriodNumber"] = periodValue;
            var requestObject = CollectionCalendarQueryStringParser.ParseQueryString(_queryStringDictionary, out _validationMessage);

            requestObject.Should().BeNull();
            _validationMessage.Should().Contain("Invalid value for PeriodNumber");
        }
        public async Task <IActionResult> RunHttp([HttpTrigger(AuthorizationLevel.Function)] HttpRequest request, ILogger log)
        {
            string validationMessage;
            var    updateRequest = CollectionCalendarQueryStringParser.ParseQueryString(request.GetQueryParameterDictionary(), out validationMessage);

            if (updateRequest == null)
            {
                return(new BadRequestErrorMessageResult(validationMessage));
            }

            await _collectionCalendarService.UpdatePeriod(updateRequest);

            return(new OkResult());
        }