public void Test_get_user_query() { RequestMap map = new RequestMap(); map.Set("min", "1"); map.Set("max", "10"); map.Set("id", BaseTest.resolveResponseValue("create_user.id")); User response = User.Read("", map); List <string> ignoreAsserts = new List <string>(); BaseTest.assertEqual(ignoreAsserts, response, "website", "hildegard.org"); BaseTest.assertEqual(ignoreAsserts, response, "address.instructions.doorman", "true"); BaseTest.assertEqual(ignoreAsserts, response, "address.instructions.text", "some delivery instructions text"); BaseTest.assertEqual(ignoreAsserts, response, "address.city", "New York"); BaseTest.assertEqual(ignoreAsserts, response, "address.postalCode", "10577"); BaseTest.assertEqual(ignoreAsserts, response, "address.id", "1"); BaseTest.assertEqual(ignoreAsserts, response, "address.state", "NY"); BaseTest.assertEqual(ignoreAsserts, response, "address.line1", "2000 Purchase Street"); BaseTest.assertEqual(ignoreAsserts, response, "phone", "1-770-736-8031"); BaseTest.assertEqual(ignoreAsserts, response, "name", "Joe Bloggs"); BaseTest.assertEqual(ignoreAsserts, response, "id", "1"); BaseTest.assertEqual(ignoreAsserts, response, "email", "*****@*****.**"); BaseTest.assertEqual(ignoreAsserts, response, "username", "jbloggs"); BaseTest.putResponse("get_user_query", response); }
public void update_user_Test() { Assert.Inconclusive("SKIPPED"); RequestMap map = new RequestMap(); map.Set("id", "1"); map.Set("phone", "1-770-736-8031"); map.Set("username", "jbloggs"); map.Set("website", "hildegard.org"); map.Set("email", "*****@*****.**"); map.Set("address.line1", "2000 Purchase Street"); map.Set("name", "Joe Bloggs"); map.Set("address.state", "NY"); map.Set("address.postalCode", "10577"); map.Set("address.city", "New York"); User response = new User(map).Update(); Assert.That("1-770-736-8031", Is.EqualTo(response["phone"].ToString()).IgnoreCase); Assert.That("hildegard.org", Is.EqualTo(response["website"].ToString()).IgnoreCase); Assert.That("true", Is.EqualTo(response["address.instructions.doorman"].ToString()).IgnoreCase); Assert.That("2000 Purchase Street", Is.EqualTo(response["address.line1"].ToString()).IgnoreCase); Assert.That("NY", Is.EqualTo(response["address.state"].ToString()).IgnoreCase); Assert.That("some delivery instructions text", Is.EqualTo(response["address.instructions.text"].ToString()).IgnoreCase); Assert.That("1", Is.EqualTo(response["id"].ToString()).IgnoreCase); Assert.That("jbloggs", Is.EqualTo(response["username"].ToString()).IgnoreCase); Assert.That("*****@*****.**", Is.EqualTo(response["email"].ToString()).IgnoreCase); Assert.That("Joe Bloggs", Is.EqualTo(response["name"].ToString()).IgnoreCase); Assert.That("10577", Is.EqualTo(response["address.postalCode"].ToString()).IgnoreCase); Assert.That("1", Is.EqualTo(response["address.id"].ToString()).IgnoreCase); Assert.That("New York", Is.EqualTo(response["address.city"].ToString()).IgnoreCase); }
public void example_parameters_Test() { RequestMap parameters = new RequestMap(); parameters.Set("CurrentRow", "1"); parameters.Set("Offset", "25"); Parameters response = Parameters.Query(parameters); Assert.That("NO", Is.EqualTo(response["ParameterList.ParameterArray.Parameter[1].Ecomm"]).IgnoreCase); Assert.That("Quarterly", Is.EqualTo(response["ParameterList.ParameterArray.Parameter[1].Period"]).IgnoreCase); Assert.That("NO", Is.EqualTo(response["ParameterList.ParameterArray.Parameter[2].Ecomm"]).IgnoreCase); Assert.That("NO", Is.EqualTo(response["ParameterList.ParameterArray.Parameter[0].Ecomm"]).IgnoreCase); Assert.That("U.S. Natural and Organic Grocery Stores", Is.EqualTo(response["ParameterList.ParameterArray.Parameter[0].Sector"]).IgnoreCase); Assert.That("U.S. Natural and Organic Grocery Stores", Is.EqualTo(response["ParameterList.ParameterArray.Parameter[1].Sector"]).IgnoreCase); Assert.That("U.S. Natural and Organic Grocery Stores", Is.EqualTo(response["ParameterList.ParameterArray.Parameter[2].Sector"]).IgnoreCase); Assert.That("Monthly", Is.EqualTo(response["ParameterList.ParameterArray.Parameter[0].Period"]).IgnoreCase); Assert.That("Success", Is.EqualTo(response["ParameterList.Message"]).IgnoreCase); Assert.That("3", Is.EqualTo(response["ParameterList.Count"].ToString()).IgnoreCase); Assert.That("US", Is.EqualTo(response["ParameterList.ParameterArray.Parameter[0].Country"]).IgnoreCase); Assert.That("Weekly", Is.EqualTo(response["ParameterList.ParameterArray.Parameter[2].Period"]).IgnoreCase); Assert.That("US", Is.EqualTo(response["ParameterList.ParameterArray.Parameter[1].Country"]).IgnoreCase); Assert.That("US", Is.EqualTo(response["ParameterList.ParameterArray.Parameter[2].Country"]).IgnoreCase); }
public void example_merchants_Test() { RequestMap parameters = new RequestMap(); parameters.Set("Details", "acceptance.paypass"); parameters.Set("PageOffset", "0"); parameters.Set("PageLength", "5"); parameters.Set("Latitude", "38.53463"); parameters.Set("Longitude", "-90.286781"); MerchantLocations response = MerchantLocations.Query(parameters); TestUtil.assert("0", response["Merchants.PageOffset"]); TestUtil.assert("3", response["Merchants.TotalCount"]); TestUtil.assert("36564", response["Merchants.Merchant[0].Id"]); TestUtil.assert("Merchant 36564", response["Merchants.Merchant[0].Name"]); TestUtil.assert("7 - Dry Cleaners And Laundry Services", response["Merchants.Merchant[0].Category"]); TestUtil.assert("Merchant 36564", response["Merchants.Merchant[0].Location.Name"]); TestUtil.assert("0.9320591049747101", response["Merchants.Merchant[0].Location.Distance"]); TestUtil.assert("MILE", response["Merchants.Merchant[0].Location.DistanceUnit"]); TestUtil.assert("3822 West Fork Street", response["Merchants.Merchant[0].Location.Address.Line1"]); TestUtil.assert("Great Falls", response["Merchants.Merchant[0].Location.Address.City"]); TestUtil.assert("51765", response["Merchants.Merchant[0].Location.Address.PostalCode"]); TestUtil.assert("Country Subdivision 517521", response["Merchants.Merchant[0].Location.Address.CountrySubdivision.Name"]); TestUtil.assert("Country Subdivision Code 517521", response["Merchants.Merchant[0].Location.Address.CountrySubdivision.Code"]); TestUtil.assert("Country 5175215", response["Merchants.Merchant[0].Location.Address.Country.Name"]); TestUtil.assert("Country Code 5175215", response["Merchants.Merchant[0].Location.Address.Country.Code"]); TestUtil.assert("38.52114017591121", response["Merchants.Merchant[0].Location.Point.Latitude"]); TestUtil.assert("-90.28678100000002", response["Merchants.Merchant[0].Location.Point.Longitude"]); TestUtil.assert("true", response["Merchants.Merchant[0].Acceptance.PayPass.Register"]); }
public void get_user_query_Test() { Assert.Inconclusive("SKIPPED"); String id = "1"; RequestMap parameters = new RequestMap(); parameters.Set("min", "1"); parameters.Set("max", "10"); User response = User.Read(id, parameters); Assert.That("1-770-736-8031", Is.EqualTo(response["phone"].ToString()).IgnoreCase); Assert.That("hildegard.org", Is.EqualTo(response["website"].ToString()).IgnoreCase); Assert.That("true", Is.EqualTo(response["address.instructions.doorman"].ToString()).IgnoreCase); Assert.That("2000 Purchase Street", Is.EqualTo(response["address.line1"].ToString()).IgnoreCase); Assert.That("NY", Is.EqualTo(response["address.state"].ToString()).IgnoreCase); Assert.That("some delivery instructions text", Is.EqualTo(response["address.instructions.text"].ToString()).IgnoreCase); Assert.That("1", Is.EqualTo(response["id"].ToString()).IgnoreCase); Assert.That("jbloggs", Is.EqualTo(response["username"].ToString()).IgnoreCase); Assert.That("*****@*****.**", Is.EqualTo(response["email"].ToString()).IgnoreCase); Assert.That("Joe Bloggs", Is.EqualTo(response["name"].ToString()).IgnoreCase); Assert.That("10577", Is.EqualTo(response["address.postalCode"].ToString()).IgnoreCase); Assert.That("1", Is.EqualTo(response["address.id"].ToString()).IgnoreCase); Assert.That("New York", Is.EqualTo(response["address.city"].ToString()).IgnoreCase); }
private static void GetConversion() { try { RequestMap map = new RequestMap(); map.Set("fxDate", "2019-03-22"); map.Set("transCurr", "USD"); map.Set("crdhldBillCurr", "BRL"); map.Set("bankFee", "0"); map.Set("transAmt", "10"); ConversionRate response = ConversionRate.Query(map); Out(response, "name"); //-->settlement-conversion-rate Out(response, "description"); //-->Settlement conversion rate and billing amount Out(response, "date"); //-->2017-11-03 03:59:50 Out(response, "data.conversionRate"); //-->0.57 Out(response, "data.crdhldBillAmt"); //-->13.11 Out(response, "data.fxDate"); //-->2016-09-30 Out(response, "data.transCurr"); //-->ALL Out(response, "data.crdhldBillCurr"); //-->DZD Out(response, "data.transAmt"); //-->23 Out(response, "data.bankFee"); //-->5 Console.ReadKey(); } catch (ApiException e) { Err("HttpStatus: {0}", e.HttpStatus.ToString()); Err("Message: {0}", e.Message); Err("ReasonCode: {0}", e.ReasonCode); Err("Source: {0}", e.Source); Console.ReadKey(); } }
public void create_post_Test() { RequestMap map = new RequestMap(); map.Set("body", "Some text as a body"); map.Set("title", "Title of Post"); Post response = Post.doCreate(map); Assert.That("1", Is.EqualTo(response["id"].ToString()).IgnoreCase); Assert.That("some body text", Is.EqualTo(response["body"].ToString()).IgnoreCase); Assert.That("My Title", Is.EqualTo(response["title"].ToString()).IgnoreCase); Assert.That("1", Is.EqualTo(response["userId"].ToString()).IgnoreCase); }
public void update_post_Test() { RequestMap map = new RequestMap(); map.Set("id", "1111"); map.Set("body", "updated body"); map.Set("title", "updated title"); Post response = new Post(map).doUpdate(); Assert.That("1", Is.EqualTo(response["id"].ToString()).IgnoreCase); Assert.That("updated body", Is.EqualTo(response["body"].ToString()).IgnoreCase); Assert.That("updated title", Is.EqualTo(response["title"].ToString()).IgnoreCase); Assert.That("1", Is.EqualTo(response["userId"].ToString()).IgnoreCase); }
public void list_users_query_Test() { Assert.Inconclusive("SKIPPED"); RequestMap map = new RequestMap(); map.Set("max", "10"); List <User> responseList = User.List(map); User response = responseList[0]; Assert.That("1-770-736-8031", Is.EqualTo(response["phone"].ToString()).IgnoreCase); Assert.That("hildegard.org", Is.EqualTo(response["website"].ToString()).IgnoreCase); Assert.That("true", Is.EqualTo(response["address.instructions.doorman"].ToString()).IgnoreCase); Assert.That("2000 Purchase Street", Is.EqualTo(response["address.line1"].ToString()).IgnoreCase); Assert.That("NY", Is.EqualTo(response["address.state"].ToString()).IgnoreCase); Assert.That("some delivery instructions text", Is.EqualTo(response["address.instructions.text"].ToString()).IgnoreCase); Assert.That("1", Is.EqualTo(response["id"].ToString()).IgnoreCase); Assert.That("jbloggs", Is.EqualTo(response["username"].ToString()).IgnoreCase); Assert.That("*****@*****.**", Is.EqualTo(response["email"].ToString()).IgnoreCase); Assert.That("Joe Bloggs", Is.EqualTo(response["name"].ToString()).IgnoreCase); Assert.That("10577", Is.EqualTo(response["address.postalCode"].ToString()).IgnoreCase); Assert.That("1", Is.EqualTo(response["address.id"].ToString()).IgnoreCase); Assert.That("New York", Is.EqualTo(response["address.city"].ToString()).IgnoreCase); }
/// <summary> /// Delete an object of type <code>MultiplePathUserPost</code> /// </summary> /// <param name="id">The unique identifier which is used to identify an MultiplePathUserPost object.</param> /// <param name="parameters">additional parameters</param> /// <returns> A MultiplePathUserPost object </returns> /// <exception cref="ApiCommunicationException"> </exception> /// <exception cref="AuthenticationException"> </exception> /// <exception cref="InvalidRequestException"> </exception> /// <exception cref="NotAllowedException"> </exception> /// <exception cref="ObjectNotFoundException"> </exception> /// <exception cref="SystemException"> </exception> public static MultiplePathUserPost Delete(String id, RequestMap parameters) { RequestMap map = new RequestMap(); map.Set("id", id); map.AddAll(parameters); return(BaseObject.Execute("84910aee-b8c5-4d86-b84c-0dc822e6937d", new MultiplePathUserPost(map))); }
/// <summary> /// Delete an object of type <code>User</code> /// </summary> /// <param name="id">The unique identifier which is used to identify an User object.</param> /// <param name="parameters">additional parameters</param> /// <returns> A User object </returns> /// <exception cref="ApiCommunicationException"> </exception> /// <exception cref="AuthenticationException"> </exception> /// <exception cref="InvalidRequestException"> </exception> /// <exception cref="NotAllowedException"> </exception> /// <exception cref="ObjectNotFoundException"> </exception> /// <exception cref="SystemException"> </exception> public static User Delete(String id, RequestMap parameters) { RequestMap map = new RequestMap(); map.Set("id", id); map.AddAll(parameters); return(BaseObject.Execute("db10ab01-2198-4abf-ade1-3868cfb3d01c", new User(map))); }
/// <summary> /// Delete an object of type <code>Post</code> /// </summary> /// <param name="id">The unique identifier which is used to identify an Post object.</param> /// <param name="parameters">additional parameters</param> /// <returns> A Post object </returns> /// <exception cref="ApiCommunicationException"> </exception> /// <exception cref="AuthenticationException"> </exception> /// <exception cref="InvalidRequestException"> </exception> /// <exception cref="NotAllowedException"> </exception> /// <exception cref="ObjectNotFoundException"> </exception> /// <exception cref="SystemException"> </exception> public static Post Delete(String id, RequestMap parameters) { RequestMap map = new RequestMap(); map.Set("id", id); map.AddAll(parameters); return(BaseObject.Execute("dff1a901-b80d-4cdf-a04b-ae5b084f95fb", new Post(map))); }
/// <summary> /// Delete an object of type <code>User</code> /// </summary> /// <param name="id">The unique identifier which is used to identify an User object.</param> /// <param name="parameters">additional parameters</param> /// <returns> A User object </returns> /// <exception cref="ApiCommunicationException"> </exception> /// <exception cref="AuthenticationException"> </exception> /// <exception cref="InvalidRequestException"> </exception> /// <exception cref="NotAllowedException"> </exception> /// <exception cref="ObjectNotFoundException"> </exception> /// <exception cref="SystemException"> </exception> public static User delete200(String id, RequestMap parameters) { RequestMap map = new RequestMap(); map.Set("id", id); map.AddAll(parameters); return(BaseObject.Execute("f6048a68-7ad7-46a4-8bd9-670641c219ac", new User(map))); }
/// <summary> /// Delete an object of type <code>User</code> /// </summary> /// <param name="id">The unique identifier which is used to identify an User object.</param> /// <param name="parameters">additional parameters</param> /// <returns> A User object </returns> /// <exception cref="ApiCommunicationException"> </exception> /// <exception cref="AuthenticationException"> </exception> /// <exception cref="InvalidRequestException"> </exception> /// <exception cref="NotAllowedException"> </exception> /// <exception cref="ObjectNotFoundException"> </exception> /// <exception cref="SystemException"> </exception> public static User delete204(String id, RequestMap parameters) { RequestMap map = new RequestMap(); map.Set("id", id); map.AddAll(parameters); return(BaseObject.Execute("1bce28cd-c900-41b6-ac86-3232903ada1f", new User(map))); }
public void Test_example_get_token() { // RequestMap map = new RequestMap(); map.Set("requestId", "123456"); map.Set("paymentAppInstanceId", "123456789"); map.Set("tokenUniqueReference", "DWSPMC000000000132d72d4fcb2f4136a0532d3093ff1a45"); map.Set("includeTokenDetail", "true"); List <string> ignoreAsserts = new List <string>(); GetToken response = GetToken.Create(map); BaseTest.assertEqual(ignoreAsserts, response, "responseId", "123456"); BaseTest.assertEqual(ignoreAsserts, response, "token.tokenUniqueReference", "DWSPMC000000000132d72d4fcb2f4136a0532d3093ff1a45"); BaseTest.assertEqual(ignoreAsserts, response, "token.status", "ACTIVE"); BaseTest.assertEqual(ignoreAsserts, response, "token.productConfig.brandLogoAssetId", "800200c9-629d-11e3-949a-0739d27e5a67"); BaseTest.assertEqual(ignoreAsserts, response, "token.productConfig.isCoBranded", "true"); BaseTest.assertEqual(ignoreAsserts, response, "token.productConfig.coBrandName", "Test CoBrand Name"); BaseTest.assertEqual(ignoreAsserts, response, "token.productConfig.coBrandLogoAssetId", "Test coBrand Logo AssetId"); BaseTest.assertEqual(ignoreAsserts, response, "token.productConfig.cardBackgroundCombinedAssetId", "739d27e5-629d-11e3-949a-0800200c9a66"); BaseTest.assertEqual(ignoreAsserts, response, "token.productConfig.foregroundColor", "000000"); BaseTest.assertEqual(ignoreAsserts, response, "token.productConfig.issuerName", "Issuing Bank"); BaseTest.assertEqual(ignoreAsserts, response, "token.productConfig.shortDescription", "Bank Rewards MasterCard"); BaseTest.assertEqual(ignoreAsserts, response, "token.productConfig.longDescription", "Bank Rewards MasterCard with the super duper rewards program"); BaseTest.assertEqual(ignoreAsserts, response, "token.productConfig.customerServiceUrl", "https://bank.com/customerservice"); BaseTest.assertEqual(ignoreAsserts, response, "token.productConfig.termsAndConditionsUrl", "https://bank.com/termsAndConditions"); BaseTest.assertEqual(ignoreAsserts, response, "token.productConfig.privacyPolicyUrl", "https://bank.com/privacy"); BaseTest.assertEqual(ignoreAsserts, response, "token.productConfig.issuerProductConfigCode", "123456"); BaseTest.assertEqual(ignoreAsserts, response, "token.tokenInfo.tokenPanSuffix", "1234"); BaseTest.assertEqual(ignoreAsserts, response, "token.tokenInfo.accountPanSuffix", "5675"); BaseTest.assertEqual(ignoreAsserts, response, "token.tokenInfo.tokenExpiry", "1018"); BaseTest.assertEqual(ignoreAsserts, response, "token.tokenInfo.dsrpCapable", "true"); BaseTest.assertEqual(ignoreAsserts, response, "token.tokenInfo.tokenAssuranceLevel", "1"); BaseTest.assertEqual(ignoreAsserts, response, "tokenDetail.encryptedData.tokenNumber", "5123456789012345"); BaseTest.assertEqual(ignoreAsserts, response, "tokenDetail.encryptedData.expiryMonth", "12"); BaseTest.assertEqual(ignoreAsserts, response, "tokenDetail.encryptedData.expiryYear", "22"); BaseTest.assertEqual(ignoreAsserts, response, "tokenDetail.tokenUniqueReference", "DWSPMC000000000132d72d4fcb2f4136a0532d3093ff1a45"); BaseTest.putResponse("example_get_token", response); }
public void example_merchants_countrysubdivision_Test() { RequestMap parameters = new RequestMap(); parameters.Set("details", "topup.repower"); parameters.Set("country", "USA"); MerchantCountrySubdivisions response = MerchantCountrySubdivisions.Query(parameters); Assert.That("ARMED FORCES AMERICAS", Is.EqualTo(response["CountrySubdivisions.CountrySubdivision[0].Name"].ToString()).IgnoreCase); Assert.That("AA", Is.EqualTo(response["CountrySubdivisions.CountrySubdivision[0].Code"].ToString()).IgnoreCase); Assert.That("ARMED FORCES CAN AFRICA E", Is.EqualTo(response["CountrySubdivisions.CountrySubdivision[1].Name"].ToString()).IgnoreCase); Assert.That("AE", Is.EqualTo(response["CountrySubdivisions.CountrySubdivision[1].Code"].ToString()).IgnoreCase); Assert.That("ALASKA", Is.EqualTo(response["CountrySubdivisions.CountrySubdivision[2].Name"].ToString()).IgnoreCase); Assert.That("AK", Is.EqualTo(response["CountrySubdivisions.CountrySubdivision[2].Code"].ToString()).IgnoreCase); }
public void Test_delete_user_posts_with_mutplie_path() { RequestMap map = new RequestMap(); map.Set("user_id", "1"); map.Set("post_id", "2"); MultiplePathUserPost response = MultiplePathUserPost.Delete("", map); Assert.NotNull(response); List <string> ignoreAsserts = new List <string>(); BaseTest.putResponse("delete_user_posts_with_mutplie_path", response); }
public void get_post_query_2_Test() { String id = "1"; RequestMap parameters = new RequestMap(); parameters.Set("min", "1"); parameters.Set("max", "10"); Post response = Post.doFind(id, parameters); Assert.That("1", Is.EqualTo(response["id"].ToString()).IgnoreCase); Assert.That("some body text", Is.EqualTo(response["body"].ToString()).IgnoreCase); Assert.That("My Title", Is.EqualTo(response["title"].ToString()).IgnoreCase); Assert.That("1", Is.EqualTo(response["userId"].ToString()).IgnoreCase); }
public void atm_locations_with_proxy_Test() { WebProxy proxy = new WebProxy("127.0.0.1", 8118); ApiConfig.SetProxy(proxy); RequestMap parameters = new RequestMap(); parameters.Set("PageOffset", "0"); parameters.Set("PageLength", "5"); parameters.Set("PostalCode", "11101"); ATMLocations response = ATMLocations.Query(parameters); TestUtil.assert("0", response["Atms.PageOffset"]); TestUtil.assert("26", response["Atms.TotalCount"]); TestUtil.assert("Sandbox ATM Location 1", response["Atms.Atm[0].Location.Name"]); //TestUtil.assert("0.9320591049747101", response["Atms.Atm[0].Location.Distance"]); TestUtil.assert("MILE", response["Atms.Atm[0].Location.DistanceUnit"]); TestUtil.assert("4201 Leverton Cove Road", response["Atms.Atm[0].Location.Address.Line1"]); TestUtil.assert("SPRINGFIELD", response["Atms.Atm[0].Location.Address.City"]); TestUtil.assert("11101", response["Atms.Atm[0].Location.Address.PostalCode"]); TestUtil.assert("UYQQQQ", response["Atms.Atm[0].Location.Address.CountrySubdivision.Name"]); TestUtil.assert("QQ", response["Atms.Atm[0].Location.Address.CountrySubdivision.Code"]); TestUtil.assert("UYQQQRR", response["Atms.Atm[0].Location.Address.Country.Name"]); TestUtil.assert("UYQ", response["Atms.Atm[0].Location.Address.Country.Code"]); TestUtil.assert("38.76006576913497", response["Atms.Atm[0].Location.Point.Latitude"]); TestUtil.assert("-90.74615107952418", response["Atms.Atm[0].Location.Point.Longitude"]); TestUtil.assert("OTHER", response["Atms.Atm[0].Location.LocationType.Type"]); TestUtil.assert("NO", response["Atms.Atm[0].HandicapAccessible"]); TestUtil.assert("NO", response["Atms.Atm[0].Camera"]); TestUtil.assert("UNKNOWN", response["Atms.Atm[0].Availability"]); TestUtil.assert("UNKNOWN", response["Atms.Atm[0].AccessFees"]); TestUtil.assert("Sandbox ATM 1", response["Atms.Atm[0].Owner"]); TestUtil.assert("NO", response["Atms.Atm[0].SharedDeposit"]); TestUtil.assert("NO", response["Atms.Atm[0].SurchargeFreeAlliance"]); TestUtil.assert("DOES_NOT_PARTICIPATE_IN_SFA", response["Atms.Atm[0].SurchargeFreeAllianceNetwork"]); TestUtil.assert("Sandbox", response["Atms.Atm[0].Sponsor"]); TestUtil.assert("1", response["Atms.Atm[0].SupportEMV"]); TestUtil.assert("1", response["Atms.Atm[0].InternationalMaestroAccepted"]); }
/// <summary> /// Retrieves one object of type <code>Post</code> /// </summary> /// <param name="id">The unique identifier which is used to identify an Post object.</param> /// <param name = "parameters">This is the optional parameter which can be passed to the request.</param> /// <returns> A Post object </returns> /// <exception cref="ApiCommunicationException"> </exception> /// <exception cref="AuthenticationException"> </exception> /// <exception cref="InvalidRequestException"> </exception> /// <exception cref="NotAllowedException"> </exception> /// <exception cref="ObjectNotFoundException"> </exception> /// <exception cref="SystemException"> </exception> public static Post Read(String id, RequestMap parameters = null) { RequestMap map = new RequestMap(); map.Set("id", id); if (parameters != null && parameters.Count > 0) { map.AddAll(parameters); } return(BaseObject.Execute("5347cde5-c964-43dc-b316-8f53d0c662c5", new Post(map))); }
/// <summary> /// Retrieves one object of type <code>User</code> /// </summary> /// <param name="id">The unique identifier which is used to identify an User object.</param> /// <param name = "parameters">This is the optional parameter which can be passed to the request.</param> /// <returns> A User object </returns> /// <exception cref="ApiCommunicationException"> </exception> /// <exception cref="AuthenticationException"> </exception> /// <exception cref="InvalidRequestException"> </exception> /// <exception cref="NotAllowedException"> </exception> /// <exception cref="ObjectNotFoundException"> </exception> /// <exception cref="SystemException"> </exception> public static User Read(String id, RequestMap parameters = null) { RequestMap map = new RequestMap(); map.Set("id", id); if (parameters != null && parameters.Count > 0) { map.AddAll(parameters); } return(BaseObject.Execute("008b48e2-a8b1-47ab-9b2d-6228a61d5dee", new User(map))); }
/// <summary> /// Retrieves one object of type <code>User</code> /// </summary> /// <param name="id">The unique identifier which is used to identify an User object.</param> /// <param name = "parameters">This is the optional paramter which can be passed to the request.</param> /// <returns> A User object </returns> /// <exception cref="ApiCommunicationException"> </exception> /// <exception cref="AuthenticationException"> </exception> /// <exception cref="InvalidRequestException"> </exception> /// <exception cref="NotAllowedException"> </exception> /// <exception cref="ObjectNotFoundException"> </exception> /// <exception cref="SystemException"> </exception> public static User Read(String id, RequestMap parameters = null) { RequestMap map = new RequestMap(); map.Set("id", id); if (parameters != null && parameters.Count > 0) { map.AddAll(parameters); } return(BaseObject.Execute("read", new User(map))); }
/// <summary> /// Retrieves one object of type <code>Post</code> /// </summary> /// <param name="id">The unique identifier which is used to identify an Post object.</param> /// <param name = "parameters">This is the optional paramter which can be passed to the request.</param> /// <returns> A Post object </returns> /// <exception cref="ApiCommunicationException"> </exception> /// <exception cref="AuthenticationException"> </exception> /// <exception cref="InvalidRequestException"> </exception> /// <exception cref="NotAllowedException"> </exception> /// <exception cref="ObjectNotFoundException"> </exception> /// <exception cref="SystemException"> </exception> public static Post doFind(String id, RequestMap parameters = null) { RequestMap map = new RequestMap(); map.Set("id", id); if (parameters != null && parameters.Count > 0) { map.AddAll(parameters); } return((Post)BaseObject.readObject(new Post(map))); }
public void Test_get_post_query_2() { RequestMap map = new RequestMap(); map.Set("min", "1"); map.Set("max", "10"); Post response = Post.Read("1", map); List <string> ignoreAsserts = new List <string>(); BaseTest.assertEqual(ignoreAsserts, response, "id", "1"); BaseTest.assertEqual(ignoreAsserts, response, "title", "My Title"); BaseTest.assertEqual(ignoreAsserts, response, "body", "some body text"); BaseTest.assertEqual(ignoreAsserts, response, "userId", "1"); BaseTest.putResponse("get_post_query_2", response); }
public void Test_get_user_posts_with_mutplie_path() { RequestMap map = new RequestMap(); map.Set("user_id", "1"); map.Set("post_id", "2"); List <MultiplePathUserPost> responseList = MultiplePathUserPost.List(map); MultiplePathUserPost response = responseList[0]; List <string> ignoreAsserts = new List <string>(); BaseTest.assertEqual(ignoreAsserts, response, "id", "1"); BaseTest.assertEqual(ignoreAsserts, response, "title", "My Title"); BaseTest.assertEqual(ignoreAsserts, response, "body", "some body text"); BaseTest.assertEqual(ignoreAsserts, response, "userId", "1"); BaseTest.putResponse("get_user_posts_with_mutplie_path", responseList[0]); }
public void Test_update_post() { RequestMap map = new RequestMap(); map.Set("id", "1111"); map.Set("title", "updated title"); map.Set("body", "updated body"); Post response = new Post(map).Update(); List <string> ignoreAsserts = new List <string>(); BaseTest.assertEqual(ignoreAsserts, response, "id", "1"); BaseTest.assertEqual(ignoreAsserts, response, "title", "updated title"); BaseTest.assertEqual(ignoreAsserts, response, "body", "updated body"); BaseTest.assertEqual(ignoreAsserts, response, "userId", "1"); BaseTest.putResponse("update_post", response); }
public static ATMLocations Get(double latitude, double longitude) { string consumerKey = "shbGabkd9bXLE4jnpYlB5AHULo5lUq8PQSZzcSi5d1e6817b!285415dee84e4affb0fb85fee8e4164a0000000000000000"; string keyAlias = "keyalias"; string keyPassword = "******"; var pathfile = Directory.GetCurrentDirectory(); string certPath = $"{pathfile}/wwwroot/hackaton-vk-sandbox.p12"; // e.g. /Users/yourname/project/sandbox.p12 | C:\Users\yourname\project\sandbox.p12 ApiConfig.SetAuthentication(new OAuthAuthentication(consumerKey, certPath, keyAlias, keyPassword)); // You only need to set this once ApiConfig.SetSandbox(true); RequestMap map = new RequestMap(); var stringLatitiude = latitude.ToString().Replace(",", "."); var stringLongitude = longitude.ToString().Replace(",", "."); map.Set("PageLength", "11"); map.Set("PostalCode", "191186"); map.Set("PageOffset", "0"); map.Set("Latitude", $"{stringLatitiude}"); map.Set("Longitude", $"{stringLongitude}"); return(ATMLocations.Query(map)); }
public void get_user_posts_with_path_Test() { RequestMap map = new RequestMap(); map.Set("user_id", "1"); List <UserPostPath> responseList = UserPostPath.List(map); UserPostPath response = responseList[0]; Assert.That("1", Is.EqualTo(response["id"].ToString()).IgnoreCase); Assert.That("some body text", Is.EqualTo(response["body"].ToString()).IgnoreCase); Assert.That("My Title", Is.EqualTo(response["title"].ToString()).IgnoreCase); Assert.That("1", Is.EqualTo(response["userId"].ToString()).IgnoreCase); }
public void testActionListWithUserPostHeader200() { RequestMap inputMap = new RequestMap(); inputMap.Set("user_id", 11); List <UserPostHeader> items = UserPostHeader.List(inputMap); Assert.AreEqual(1, items.Count); UserPostHeader item = items [0]; Assert.AreEqual(item.Get("id"), 1); Assert.AreEqual(item.Get("title"), "My Title"); Assert.AreEqual(item.Get("body"), "some body text"); Assert.AreEqual(item.Get("userId"), 1); }
public void list_posts_query_2_Test() { RequestMap map = new RequestMap(); map.Set("max", "10"); List <Post> responseList = Post.doList(map); Post response = responseList[0]; Assert.That("1", Is.EqualTo(response["id"].ToString()).IgnoreCase); Assert.That("some body text", Is.EqualTo(response["body"].ToString()).IgnoreCase); Assert.That("My Title", Is.EqualTo(response["title"].ToString()).IgnoreCase); Assert.That("1", Is.EqualTo(response["userId"].ToString()).IgnoreCase); }