public void LeaveFeedback() { Assert.IsNotNull(TestData.NewItem, "Failed because no item available -- requires successful AddItem test"); // LeaveFeedbackCall api = new LeaveFeedbackCall(this.apiContext); FeedbackDetailType fb = new FeedbackDetailType(); api.ItemID = TestData.NewItem.ItemID; api.CommentText = "SDK Sanity test feedback"; api.CommentType = CommentTypeCodeType.Positive; api.TransactionID = "0"; api.TargetUser = "******"; // Make API call. ApiException gotException = null; try { api.Execute(); } catch (ApiException ex) { gotException = ex; } Assert.IsNotNull(gotException); }
public void FeedbackLeft() { JsonServiceStub stub = new JsonServiceStub(@"{ ""Timestamp"":""2014-08-28T04:17:24.636Z"", ""Ack"":""Success"", ""Build"":""E847_CORE_APINOT_16496971_R1"", ""Version"":""847"", ""ClientAlerts"": { ""ClientAlertEvent"":[ { ""EventType"":""FeedbackLeft"", ""FeedbackLeft"": { ""EventType"":""FeedbackLeft"", ""Timestamp"":""2014-08-28T04:16:38.272Z"", ""FeedbackDetail"": { ""CommentingUser"":""beachrife"", ""CommentText"":""★★★★★ Thank you for shopping at BeachRife. ★★★★★"", ""CommentType"":""Positive"", ""ItemID"":""171389168684"", ""Role"":""Seller"", ""ItemTitle"":""HURLEY Mens ICON Tee T Shirt Top (S M L XL XXL) NEW"", ""ItemPrice"":{""Value"":26.95,""CurrencyID"":""AUD""}, ""FeedbackID"":""994813814014"", ""TransactionID"":""1256593884007"", ""FeedbackScore"":50674 } } }] }, ""SessionData"":""AQAAAUgZ6WgAAA1TSUQ9NDc0MDQyNHxTVD0xfDF8TEFDVFY9MTQwOTE5OTQ0NDYzNnxFSFdNPTE4MjAwODI1MDAxfFRJRFg9MXxMSVVQPTE0MDkxOTkyNjQyODl8UExIUz1bXTYTsAoPHttjUHE457u2q+kO4JwK"" } "); GetUserAlertsCall call = new GetUserAlertsCall(this.Logger, stub); call.Execute(); Assert.IsNotNull(call.ApiResponse.ClientAlerts); Assert.IsNotNull(call.ApiResponse.ClientAlerts.ClientAlertEvent); Assert.AreEqual(ClientAlertsEventTypeCodeType.FeedbackLeft, call.ApiResponse.ClientAlerts.ClientAlertEvent[0].EventType); Assert.AreEqual(1, call.ApiResponse.ClientAlerts.ClientAlertEvent.Length); Assert.IsInstanceOfType(call.ApiResponse.ClientAlerts.ClientAlertEvent[0], typeof(FeedbackLeftEventType)); FeedbackLeftEventType eventType = (FeedbackLeftEventType)call.ApiResponse.ClientAlerts.ClientAlertEvent[0]; Assert.AreEqual(ClientAlertsEventTypeCodeType.FeedbackLeft, eventType.EventType); Assert.AreEqual(new DateTime(2014, 08, 28, 4, 16, 38, 272, DateTimeKind.Utc), eventType.Timestamp); Assert.IsNotNull(eventType.FeedbackDetail); FeedbackDetailType feedbackDetail = eventType.FeedbackDetail; Assert.AreEqual("beachrife", feedbackDetail.CommentingUser); Assert.AreEqual("★★★★★ Thank you for shopping at BeachRife. ★★★★★", feedbackDetail.CommentText); Assert.AreEqual(CommentTypeCodeType.Positive, feedbackDetail.CommentType); Assert.AreEqual("171389168684", feedbackDetail.ItemID); Assert.AreEqual(TradingRoleCodeType.Seller, feedbackDetail.Role); Assert.AreEqual("HURLEY Mens ICON Tee T Shirt Top (S M L XL XXL) NEW", feedbackDetail.ItemTitle); Assert.IsNotNull(feedbackDetail.ItemPrice); Assert.AreEqual(26.95, feedbackDetail.ItemPrice.Value); Assert.AreEqual("AUD", feedbackDetail.ItemPrice.CurrencyID); Assert.AreEqual("994813814014", feedbackDetail.FeedbackID); Assert.AreEqual("1256593884007", feedbackDetail.TransactionID); Assert.AreEqual(50674, feedbackDetail.FeedbackScore); }
public void FeedbackReceived() { JsonServiceStub stub = new JsonServiceStub(@"{ ""Timestamp"":""2014-08-21T04:05:18.408Z"", ""Ack"":""Success"", ""Build"":""E847_CORE_APINOT_16496971_R1"", ""Version"":""847"", ""ClientAlerts"": { ""ClientAlertEvent"":[ { ""EventType"":""FeedbackReceived"", ""FeedbackReceived"": { ""EventType"":""FeedbackReceived"", ""Timestamp"":""2014-08-21T04:01:23.579Z"", ""FeedbackDetail"": { ""CommentingUser"":""cooch07"", ""CommentText"":""Thank You"", ""CommentType"":""Positive"", ""ItemID"":""121272962371"", ""Role"":""Buyer"", ""ItemTitle"":""VON ZIPPER Boys HOWLING T Shirt Top (10 12) NEW *Billabong Co."", ""ItemPrice"": { ""Value"":19.95, ""CurrencyID"":""AUD"" }, ""FeedbackID"":""929232133022"", ""TransactionID"":""1336041473002"", ""FeedbackScore"":50540 } } }] }, ""SessionData"":""AQAAAUf13OQAAA1TSUQ9NDA1MTI2M3xTVD0xfDF8TEFDVFY9MTQwODU5MzkxODM5M3xFSFdNPTE4MDUwNzc4NTMzfFRJRFg9MXxMSVVQPTE0MDg1OTMyNjE5MjJ8UExIUz1bXea4wEEeBR+lvVNEOtRmM9Gnk4Ei"" }" ); GetUserAlertsCall call = new GetUserAlertsCall(this.Logger, stub); call.Execute(); Assert.IsNotNull(call.ApiResponse.ClientAlerts); Assert.IsNotNull(call.ApiResponse.ClientAlerts.ClientAlertEvent); Assert.AreEqual(ClientAlertsEventTypeCodeType.FeedbackReceived, call.ApiResponse.ClientAlerts.ClientAlertEvent[0].EventType); Assert.AreEqual(1, call.ApiResponse.ClientAlerts.ClientAlertEvent.Length); Assert.IsInstanceOfType(call.ApiResponse.ClientAlerts.ClientAlertEvent[0], typeof(FeedbackReceivedEventType)); FeedbackReceivedEventType eventType = (FeedbackReceivedEventType)call.ApiResponse.ClientAlerts.ClientAlertEvent[0]; Assert.AreEqual(ClientAlertsEventTypeCodeType.FeedbackReceived, eventType.EventType); Assert.AreEqual(new DateTime(2014, 08, 21, 4, 1, 23, 579, DateTimeKind.Utc), eventType.Timestamp); Assert.IsNotNull(eventType.FeedbackDetail); FeedbackDetailType feedbackDetail = eventType.FeedbackDetail; Assert.AreEqual("cooch07", feedbackDetail.CommentingUser); Assert.AreEqual("Thank You", feedbackDetail.CommentText); Assert.AreEqual(CommentTypeCodeType.Positive, feedbackDetail.CommentType); Assert.AreEqual("121272962371", feedbackDetail.ItemID); Assert.AreEqual(TradingRoleCodeType.Buyer, feedbackDetail.Role); Assert.AreEqual("VON ZIPPER Boys HOWLING T Shirt Top (10 12) NEW *Billabong Co.", feedbackDetail.ItemTitle); Assert.IsNotNull(feedbackDetail.ItemPrice); Assert.AreEqual(19.95, feedbackDetail.ItemPrice.Value); Assert.AreEqual("AUD", feedbackDetail.ItemPrice.CurrencyID); Assert.AreEqual("929232133022", feedbackDetail.FeedbackID); Assert.AreEqual("1336041473002", feedbackDetail.TransactionID); Assert.AreEqual(50540, feedbackDetail.FeedbackScore); }