예제 #1
0
 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));
 }
예제 #2
0
        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());
        }
예제 #3
0
        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());
        }