コード例 #1
0
        public void TestSearchOptionInvalidSelf(ValidOptionId optionId, InvalidOptionSelf optionSelf)
        {
            OptionManager optionHandler            = new OptionManager();
            Dictionary <string, string> requestDic = new Dictionary <string, string>()
            {
                ["self"] = InvalidSelfMapper[optionSelf],
            };

            ValidIdMapper[optionId](requestDic, OptionCreater.Data.Id);
            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 id = {optionId.ToString()} and self = {optionSelf.ToString()}");
        }
コード例 #2
0
        public void TestSearchOptionAliasInvalidSelf(ValidOptionAlias optionAlias, InvalidOptionSelf optionSelf)
        {
            OptionManager optionHandler            = new OptionManager();
            Dictionary <string, string> requestDic = new Dictionary <string, string>()
            {
                ["alias"] = ValidAliasMapper[optionAlias],
                ["self"]  = InvalidSelfMapper[optionSelf],
            };
            var response = optionHandler.SearchOption(requestDic);

            PrAssert.That(response, PrIs.ErrorResponse().And.HttpCode(HttpStatusCode.BadRequest).And.ErrorCode((int)ResultCode.InvalidValue).Or.ErrorCode((int)ResultCode.ValueRangeExceeded), $"Still able to search option with both alias = {optionAlias.ToString()} and self = {optionSelf.ToString()}");
        }