Esempio n. 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()}");
        }
Esempio n. 2
0
        public void TestSearchOptionInvalidLevelCount(ValidOptionId optionId, InvalidOptionLevel optionLevel, InvalidOptionCount optionCount)
        {
            OptionManager optionHandler            = new OptionManager();
            Dictionary <string, string> requestDic = new Dictionary <string, string>()
            {
                ["level"] = InvalidLevelMapper[optionLevel],
                ["count"] = InvalidCountMapper[optionCount],
            };

            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).Or.ErrorCode((int)ResultCode.ValueRangeExceeded), $"Still able to search option with both id = {optionId.ToString()}, level = {optionLevel.ToString()} and count = {optionCount.ToString()}");
        }
Esempio n. 3
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()}");
        }