Ejemplo n.º 1
0
        public void CanConvertToJsonMinimal()
        {
            // arrange
            var request = new CompleteCheckoutSessionRequest(99, Currency.EUR);

            // act
            string json  = request.ToJson();
            string json2 = request.ToJson();

            // assert
            Assert.AreEqual(json, json2);
            Assert.AreEqual("{\"chargeAmount\":{\"amount\":99,\"currencyCode\":\"EUR\"}}", json);
        }
Ejemplo n.º 2
0
        public void CanConvertToJsonMultiship()
        {
            // arrange
            var request = new CompleteCheckoutSessionRequest(99, Currency.EUR);

            request.TotalOrderAmount.Amount       = 299.99m;
            request.TotalOrderAmount.CurrencyCode = Currency.EUR;

            // act
            string json  = request.ToJson();
            string json2 = request.ToJson();

            // assert
            Assert.AreEqual(json, json2);
            Assert.AreEqual("{\"chargeAmount\":{\"amount\":99,\"currencyCode\":\"EUR\"},\"totalOrderAmount\":{\"amount\":299.99,\"currencyCode\":\"EUR\"}}", json);
        }