public void TestPatchValidDuplicateMediumAccount(Enums.ValidDuplicated dup, MediumAccountWriteParameters param)
        {
            var handler  = new DefaultManager();
            var request  = DuplicateValues[dup]()[param.GetEnumStringValue()];
            var response = handler.Send <object>($"{MediumAccountEndpoint}/{MediumId}", request, HttpMethod.PATCH);

            Assert.That(response, PrIs.SuccessfulResponse().And.HttpCode(System.Net.HttpStatusCode.NoContent));
        }
Пример #2
0
        public void InvalidDuplicateParamGetAclActionListTests(Params param, DuplicateValues value)
        {
            string unixTime = Utils.DateTimeToUnix(null).ToString();
            var    request  = new Dictionary <string, string>()
            {
                [Params._.ToString()] = unixTime
            }.ToList <KeyValuePair <string, string> >();

            if (value == DuplicateValues.Same)
            {
                request.Add(new KeyValuePair <string, string>(param.ToString(), unixTime));
            }
            else if (value == DuplicateValues.NotSame)
            {
                request.Add(new KeyValuePair <string, string>(param.ToString(), Utils.DateTimeToUnix(null).ToString()));
            }

            var defaultManager = new DefaultManager();
            var response       = defaultManager.Send <object>(Endpoint, request, HttpMethod.GET);

            PrAssert.That(response, PrIs.SuccessfulResponse().And.HttpCode((int)System.Net.HttpStatusCode.OK));
        }
Пример #3
0
        public void DuplicateParamenterConfigurationServiceTest(Method method, Parameters parameter, DuplicateValues duplicateValue)
        {
            var    request  = new Dictionary <string, string>(DefaultParameters);
            var    handler  = new ConfigurationServiceManager();
            string bodyJson = DuplicateMapping[parameter](duplicateValue, request);
            var    response = handler.ConfigurationService <object>(request["service"], request["id"], bodyJson, System.Net.Http.HttpMethod.Put);

            PrAssert.That(response, PrIs.ErrorResponse());
        }