Exemple #1
0
        public void SearchOptionWithDuplicateParams(DuplicateParam type)
        {
            var optionSchemaHandler = new OptionSchemaManager();
            var prop = DuplicateParamMapper(type);

            var result = optionSchemaHandler.Search <string>(prop, System.Net.Http.HttpMethod.Post);

            PrAssert.That(result, PrIs.ErrorResponse().And.HttpCode(HttpStatusCode.BadRequest).And.ErrorCode((int)ResultCode.InvalidParameter));
        }
Exemple #2
0
        public void SearchOptionsWithoutParameter()
        {
            var optionSchemaHandler = new OptionSchemaManager(false);
            var prop = new Dictionary <string, object> {
            };

            var result = optionSchemaHandler.Search <OptionsSchemaSearchResponse>(prop, System.Net.Http.HttpMethod.Post);

            PrAssert.That(result, PrIs.ErrorResponse().And.HttpCode(HttpStatusCode.BadRequest).And.ErrorCode((int)ResultCode.InvalidParameter), "Code: 100. Error");
        }
Exemple #3
0
        private void PerformTest(Dictionary <string, object> request, bool isSuccessTest = true)
        {
            var optionSchemaHandler = new OptionSchemaManager(false);
            var result = optionSchemaHandler.Search <OptionsSchemaSearchResponse>(request, System.Net.Http.HttpMethod.Post);

            if (isSuccessTest)
            {
                PrAssert.That(result, PrIs.SuccessfulResponse().And.HttpCode(HttpStatusCode.OK));
            }
            else
            {
                PrAssert.That(result, PrIs.ErrorResponse().And.HttpCode(HttpStatusCode.BadRequest));
                PrAssert.That(result.Errors.Code, PrIs.WithErrorCode((int)ResultCode.InvalidValue));
            }
        }