private static void disableId(string id) { string query = "/api/interceptor/" + id; DeviceStatusPutJSON json = new DeviceStatusPutJSON(); GenericRequest intReq = new GenericRequest(TestGlobals.adminServer, query, json); Test intTest = new Test(intReq); HttpClient client; Console.WriteLine(intReq.getUri().ToString()); client = new HttpClient(); client.DefaultRequestHeaders.Authorization = AuthenticateTest.getSessionToken(); AsyncContext.Run(async () => await new HTTPSCalls().runTest(intTest, HTTPOperation.PUT, client)); Console.WriteLine(HTTPSCalls.result.Value); }
//[Test()] public static void removeInterceptor() { disableId(TestGlobals.intSerialCreated); string query = "/api/interceptor/" + TestGlobals.intSerialCreated; GenericRequest intReq = new GenericRequest(TestGlobals.adminServer, query, null); Test intTest = new Test(intReq); HttpClient client; Console.WriteLine(intReq.getUri().ToString()); client = new HttpClient(); client.DefaultRequestHeaders.Authorization = AuthenticateTest.getSessionToken(); AsyncContext.Run(async () => await new HTTPSCalls().runTest(intTest, HTTPOperation.DELETE, client)); Console.WriteLine(HTTPSCalls.result.Value); string statusCode = HTTPSCalls.result.Key.GetValue ("StatusCode").ToString (); Assert.AreEqual ("204", statusCode); intStore = HTTPSCalls.result; }