示例#1
0
        public void TestSearchOptionFieldInvalidType(ValidOptionField optionField, InvalidOptionType optionType)
        {
            OptionManager optionHandler            = new OptionManager();
            Dictionary <string, string> requestDic = new Dictionary <string, string>()
            {
                ["columns"] = ValidFieldMapper[optionField],
                ["type"]    = InvalidTypeMapper[optionType],
            };
            var response = optionHandler.SearchOption(requestDic);

            PrAssert.That(response, PrIs.ErrorResponse().And.HttpCode(HttpStatusCode.BadRequest).And.ErrorCode((int)ResultCode.InvalidValue), $"Still able to search option with both field = {optionField.ToString()} and type = {optionType.ToString()}");
        }
示例#2
0
        public void TestSearchOptionInvalidFieldOrder(ValidOptionField optionField, InvalidOptionOrder optionOrder)
        {
            OptionManager optionHandler            = new OptionManager();
            Dictionary <string, string> requestDic = new Dictionary <string, string>()
            {
                ["order"] = $"{ValidFieldMapper[optionField]}:{InvalidOrderMapper[optionOrder]}",
            };
            var response = optionHandler.SearchOption(requestDic);

            PrAssert.That(response, PrIs.ErrorResponse().And.HttpCode(HttpStatusCode.BadRequest).And.ErrorCode((int)ResultCode.InvalidValue), $"Still able to search option with both field = {optionField.ToString()} and order = {optionOrder.ToString()}");
        }