public void TestRetrieveAnnouncement() { var announcementResponse = AnnouncementResponseBuilder.NewInstance(); var merchantOrderStatusResponse = MerchantOrderStatusResponseBuilder.NewInstance(); var merchantOrderStatusResponseAsJson = MerchantOrderStatusResponseBuilder.NewInstanceAsJson(); _connector.Setup(s => s.GetAnnouncementData(announcementResponse)).Returns(merchantOrderStatusResponseAsJson); var result = _client.RetrieveAnnouncement(announcementResponse); Assert.AreEqual(merchantOrderStatusResponse, result); }
public void TestGetAnnouncementData() { var announcement = AnnouncementResponseBuilder.NewInstance(); var expectedResponse = MakeAnnouncementResponse(announcement.EventName); PrepareTokenProviderWithAccessToken(_accessToken); _restTemplate.Setup(s => s.Get("order/server/api/events/results/" + announcement.EventName, null)).Returns(expectedResponse); var actualResponse = _connector.GetAnnouncementData(announcement); _restTemplate.Verify(v => v.SetToken("MyJwt")); _restTemplate.Verify(v => v.Get("order/server/api/events/results/" + announcement.EventName, null)); Assert.AreEqual(expectedResponse, actualResponse); }