Пример #1
0
        public void TestInvalidSortTemplate(SortParameters param, InvalidValue invalid)
        {
            var handler = new DefaultManager();
            var request = BuildSortRequest(1, Ids);
            var item    = request["template_0"] as Dictionary <string, object>;

            if (invalid == InvalidValue.MissingParam)
            {
                item.Remove(param.GetEnumStringValue());
            }
            else
            {
                InvalidValueMapper[invalid](item, param.GetEnumStringValue());
            }
            request["template_0"] = item;
            var response = handler.Send <object>(TemplatesEndPoint, JsonConvert.SerializeObject(request), HttpMethod.PUT);

            PrAssert.That(response, PrIs.ErrorResponse().And.HttpCode(System.Net.HttpStatusCode.BadRequest));
        }
Пример #2
0
        public void TestInvalidUpdateTemplatesInjection(SortParameters param, Enums.InvalidInjection invalid)
        {
            var handler = new DefaultManager();
            var request = BuildSortRequest(1, new List <int> {
                Id
            });

            request[param.GetEnumStringValue()] = MapperData.InvalidInjectionMapper[invalid];
            var response = handler.Send <object>(TemplatesEndPoint, JsonConvert.SerializeObject(request), HttpMethod.PUT);

            PrAssert.That(response, PrIs.ErrorResponse().And.HttpCode(System.Net.HttpStatusCode.BadRequest));
        }