public async Task MakeECommercePayment_Throws_Http_Exception_For_Not_Ok_Status_Codes() { var mockHttp = MockHttp.WithStatus(500); var client = new SwishClient(mockHttp, _merchantId); await Assert.ThrowsAsync <HttpRequestException>(() => client.MakeECommercePaymentAsync(_defaultECommercePaymentModel)); }
public async Task MakeMCommercePaymentAsync_Returns_Correct_ErrorMessage(int status, string message) { var mockHttp = MockHttp.WithStatus(status); var client = new SwishClient(mockHttp, _merchantId); var result = await client.MakeMCommercePaymentAsync(_defaultMCommercePaymentModel); result.ErrorMessage.Should().Contain(message); result.ErrorCode.Should().Be(status.ToString()); }
public async Task GetPaymeentStatus_Returns_Correct_ErrorMessage(int status, string message) { var mockHttp = MockHttp.WithStatus(status); var client = new SwishClient(mockHttp, _merchantId); var result = await client.GetPaymentStatus(SwishId); result.ErrorMessage.Should().Contain(message); result.ErrorCode.Should().Be(status.ToString()); }