public void GetActions_ExtractsActions(string valid, IEnumerable <string> actions) { // Arrange Initialize(TestSecret); CustomReceiverMock mock = new CustomReceiverMock(); JObject data = JObject.Parse(valid); // Act IEnumerable <string> actual = mock.GetActions(data, _postRequest); // Assert Assert.Equal(actions, actual); }
public async Task GetActions_Throws_IfInvalidData(string invalid) { Initialize(TestSecret); CustomReceiverMock mock = new CustomReceiverMock(); JObject data = JObject.Parse(invalid); // Act HttpResponseException ex = Assert.Throws <HttpResponseException>(() => mock.GetActions(data, _postRequest)); // Assert HttpError error = await ex.Response.Content.ReadAsAsync <HttpError>(); Assert.StartsWith("Could not parse WebHook data: ", error.Message); }