/// <summary> /// Invokes an HTTP POST to create a new <see cref="LandingPage"/> /// </summary> /// <param name="landingPage"></param> /// <returns></returns> public LandingPage CreateLandingPage(LandingPage landingPage) { RestRequest request = new RestRequest(Method.POST) { Resource = "/assets/landingPage", RequestFormat = DataFormat.Json }; request.AddBody(landingPage); IRestResponse<LandingPage> response = _client.Execute<LandingPage>(request); return response.Data; }
public void CreateLandingPage() { LandingPage landingPage = new LandingPage { name = "sample landing page", htmlContent = new RawHtmlContent { type = "RawHtmlContent", html = "<html><head></head><body>Sample Landing Page</body></html>" } }; LandingPage returnedLandingPage = _landingPageHelper.CreateLandingPage(landingPage); Assert.AreEqual(landingPage.name, returnedLandingPage.name); }