Ejemplo n.º 1
0
 public void Disposes_Successfully_MultipleTimes()
 {
     using (var client = new LaybuyClient(new LaybuyClientConfiguration(new LaybuyCredentials("A", "A"))))
     {
         client.Dispose();
         client.Dispose();
     }
 }
Ejemplo n.º 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()
                    });
                }
                );
            }
        }
Ejemplo n.º 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()
                    });
                }
                );
            }
        }
Ejemplo n.º 4
0
 public void Disposes_Successfully()
 {
     using (var client = new LaybuyClient(new LaybuyClientConfiguration(new LaybuyCredentials("A", "A"))))
     {
     }
 }