Ejemplo n.º 1
0
        public void TestSearchOptionAliasInvalidLevel(ValidOptionAlias optionAlias, InvalidOptionLevel optionLevel)
        {
            OptionManager optionHandler            = new OptionManager();
            Dictionary <string, string> requestDic = new Dictionary <string, string>()
            {
                ["alias"] = ValidAliasMapper[optionAlias],
                ["level"] = InvalidLevelMapper[optionLevel],
            };
            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 level = {optionLevel.ToString()}");
        }
Ejemplo 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()}");
        }