コード例 #1
0
 public void Disposes_Successfully_MultipleTimes()
 {
     using (var client = new LaybuyClient(new LaybuyClientConfiguration(new LaybuyCredentials("A", "A"))))
     {
         client.Dispose();
         client.Dispose();
     }
 }
コード例 #2
0
        public void Throws_On_Get_Request_After_Dispose()
        {
            using (var client = new LaybuyClient(new LaybuyClientConfiguration(new LaybuyCredentials("A", "A"))))
            {
                client.Dispose();

                Assert.ThrowsExceptionAsync <ObjectDisposedException>
                (
                    async() =>
                {
                    _ = await client.GetOrderStatus(new OrderStatusRequest()
                    {
                        MerchantReference = System.Guid.NewGuid().ToString()
                    });
                }
                );
            }
        }
コード例 #3
0
        public void Throws_On_Post_Request_After_Dispose()
        {
            using (var client = new LaybuyClient(new LaybuyClientConfiguration(new LaybuyCredentials("A", "A"))))
            {
                client.Dispose();

                Assert.ThrowsExceptionAsync <ObjectDisposedException>
                (
                    async() =>
                {
                    _ = await client.Refund(new RefundRequest()
                    {
                        Amount = 10, Note = "Test", OrderId = 1234, RefundMerchantReference = System.Guid.NewGuid().ToString()
                    });
                }
                );
            }
        }