Exemplo n.º 1
0
        public void TestSearchOptionIdAlias(ValidOptionId optionId, ValidOptionAlias optionAlias)
        {
            OptionManager optionHandler            = new OptionManager();
            Dictionary <string, string> requestDic = new Dictionary <string, string>()
            {
                ["alias"] = ValidAliasMapper[optionAlias],
            };

            ValidIdMapper[optionId](requestDic, OptionCreater.Data.Id);

            var response = optionHandler.SearchOption(requestDic);

            PrAssert.That(response, PrIs.ErrorResponse().And.HttpCode(HttpStatusCode.BadRequest).And.ErrorCode((int)ResultCode.InvalidParameter), $"Still able to search option with both id = {optionId.ToString()} and alias = {optionAlias.ToString()}");
        }
Exemplo n.º 2
0
        public void TestSearchOptionAliasInvalidLevelCount(ValidOptionAlias optionAlias, InvalidOptionLevel optionLevel, InvalidOptionCount optionCount)
        {
            OptionManager optionHandler            = new OptionManager();
            Dictionary <string, string> requestDic = new Dictionary <string, string>()
            {
                ["alias"] = ValidAliasMapper[optionAlias],
                ["level"] = InvalidLevelMapper[optionLevel],
                ["count"] = InvalidCountMapper[optionCount],
            };
            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 count = {optionCount.ToString()}");
        }