public static void createNewOffer() { Console.WriteLine("\ncreateNewOffer Test"); string query = "campaign-manager/Offers/?orgId=" + TestGlobals.orgIdWithCampSignedUp; OfferJSON json = new OfferJSON ("new offer for QA testing", TestGlobals.orgIdWithCampSignedUp, "123", "blah blah blah"); GenericRequest postOffer = new GenericRequest (TestGlobals.campaignServer, query, json); Test mTest = new Test (postOffer); HttpClient client = new HttpClient (); client.DefaultRequestHeaders.Authorization = AuthenticateTest.getSessionToken(); AsyncContext.Run (async () => await new HTTPSCalls ().runTest (mTest, HTTPOperation.POST, client)); string statusCode = HTTPSCalls.result.Key.GetValue ("StatusCode").ToString (); Console.WriteLine(HTTPSCalls.result.Value); Console.WriteLine(HTTPSCalls.result.Key.ToString()); Console.WriteLine(HTTPSCalls.result.Value.Substring(7, 36)); TestGlobals.offerId = HTTPSCalls.result.Value.Substring (7, 36); Assert.AreEqual ("200", statusCode); }
public static void newOffer() { string query = "campaign-manager/Offers/?orgId=" + TestGlobals.orgIdWithCampSignedUp; OfferJSON json = new OfferJSON ("new offer for QA testing", TestGlobals.orgIdWithCampSignedUp, "123", "blah blah blah"); GenericRequest postOffer = new GenericRequest (TestGlobals.campaignServer, query, json); Test mTest = new Test (postOffer); HttpClient client = new HttpClient (); client.DefaultRequestHeaders.Authorization = AuthenticateTest.getSessionToken(); AsyncContext.Run (async () => await new HTTPSCalls ().runTest (mTest, HTTPOperation.POST, client)); //setting global offer ID to the new offer created TestGlobals.offerId = HTTPSCalls.result.Value.Substring (7, 36); }