コード例 #1
0
 public static void createInt(string locID)
 {
     string loc = locID;
     Console.WriteLine("Creating intercepter w/ loc:");
     Console.WriteLine(loc);
     idPost();
     InterceptorJSON json = new InterceptorJSON(int.Parse(TestGlobals.locIdCreated), TestGlobals.intSerialCreated, "wappisk", "AYYYYLMAO");
     Interceptor newInt = new Interceptor(TestGlobals.adminServer, TestGlobals.intIdCreated, json);
     Test mTest = new Test(newInt);
     HttpClient client = new HttpClient();
     client.DefaultRequestHeaders.Authorization = AuthenticateTest.getSessionToken();
     Console.WriteLine(newInt.getJson().ToString());
     AsyncContext.Run(async () => await new HTTPSCalls().runTest(mTest, HTTPOperation.POST, client));
     Console.WriteLine(HTTPSCalls.result.Value.ToString());
 }
コード例 #2
0
        //[Test()]
        public static void invalidLocID()
        {
            string loc = "000";
            Console.WriteLine("Creating intercepter w/ loc:");
            Console.WriteLine(loc);

            idPost ();
            InterceptorJSON json = new InterceptorJSON (int.Parse (loc), TestGlobals.intSerialCreated, "wappisk", "HEYYYYYYY");
            Interceptor newInt = new Interceptor (TestGlobals.adminServer, TestGlobals.intIdCreated, json);
            Test mTest = new Test (newInt);
            HttpClient client = new HttpClient ();
            client.DefaultRequestHeaders.Authorization = AuthenticateTest.getSessionToken ();
            Console.WriteLine(newInt.getJson().ToString());
            AsyncContext.Run (async () => await new HTTPSCalls().runTest(mTest, HTTPOperation.POST, client));
            string statusCode = HTTPSCalls.result.Key.Property ("StatusCode").Value.ToString ();
            Assert.AreEqual ("412", statusCode);
            Console.WriteLine(HTTPSCalls.result.Value.ToString());
            intStore = HTTPSCalls.result;
        }