public void SetUserPreferences() { if (TestData.UserPreferencesResponse == null) { return; } SetUserPreferencesCall api = new SetUserPreferencesCall(this.apiContext); api.BidderNoticePreferences = TestData.UserPreferencesResponse.BidderNoticePreferences; // api.CombinedPaymentPreferences = TestData.UserPreferencesResponse.CombinedPaymentPreferences; api.CrossPromotionPreferences = TestData.UserPreferencesResponse.CrossPromotionPreferences; api.EndOfAuctionEmailPreferences = TestData.UserPreferencesResponse.EndOfAuctionEmailPreferences; api.SellerFavoriteItemPreferences = TestData.UserPreferencesResponse.SellerFavoriteItemPreferences; api.SellerPaymentPreferences = TestData.UserPreferencesResponse.SellerPaymentPreferences; // Make API call. ApiException gotException = null; try { api.Execute(); } catch (ApiException e) { gotException = e; } Assert.IsTrue(gotException == null || gotException.containsErrorCode("249")); }
public void GetAccount() { GetAccountCall api = new GetAccountCall(this.apiContext); api.AccountHistorySelection = AccountHistorySelectionCodeType.LastInvoice; /* * System.DateTime calTo = System.DateTime.Instance; * System.DateTime calFrom = (System.DateTime)calTo.clone(); * calFrom.add(System.DateTime.DATE, -1); * TimeFilter tf = new TimeFilter(calFrom, calTo); * api.ViewPeriod = tf; */ // Pagination PaginationType pt = new PaginationType(); pt.EntriesPerPage = 0; // No details will be returned. pt.EntriesPerPageSpecified = true; pt.PageNumber = 1; pt.PageNumberSpecified = true; api.Pagination = pt; ApiException gotException = null; try { api.GetAccount(AccountHistorySelectionCodeType.LastInvoice); } catch (ApiException e) { gotException = e; } Assert.IsTrue(gotException == null || gotException.containsErrorCode("20154")); }
public void ValidateChallengeInput() { ValidateChallengeInputCall api = new ValidateChallengeInputCall(this.apiContext); api.ChallengeToken = TestData.ChallengeToken; if (api.ChallengeToken == null) { api.ChallengeToken = "token"; } api.KeepTokenValid = true; api.UserInput = "MYINPUT"; // Make API call. ApiException gotException = null; try { api.Execute(); bool isValid = api.ValidToken; } catch (ApiException ex) { gotException = ex; } Assert.IsTrue(gotException == null || gotException.containsErrorCode("517")); }
public void GetChallengeToken() { GetChallengeTokenCall api = new GetChallengeTokenCall(this.apiContext); // Make API call. ApiException gotException = null; try { api.Execute(); TestData.AudioChallengeURL = api.AudioChallengeURL; TestData.ChallengeToken = api.ChallengeToken; TestData.ImageChallengeURL = api.ImageChallengeURL; } catch (ApiException ex) { gotException = ex; } Assert.IsTrue(gotException == null || gotException.containsErrorCode("517")); }