Esempio n. 1
0
        public void Order_Bug13354_OrderTotalsZero()
        {
            //Create API Proxy
            var proxy = CreateApiProxy();

            //Find order by Unique Identifier
            var resOrder = proxy.OrdersFind(TestConstants.TestOrder1Bvin);

            CheckErrors(resOrder);
            var dto = resOrder.Content;

            Assert.AreEqual(dto.OrderNumber, TestConstants.TestOrder1Number);
            Assert.AreEqual(dto.TotalGrand, TestConstants.TestOrder1TotalGrand);

            //Find Order Properties
            var prop = dto.CustomProperties.FirstOrDefault(p => p.DeveloperId == "test" && p.Key == "TestProp");

            if (prop == null)
            {
                prop = new CustomPropertyDTO {
                    DeveloperId = "test", Key = "TestProp"
                };
                dto.CustomProperties.Add(prop);
            }
            prop.Value = "Some Value";

            //Update Order
            var resOrder2 = proxy.OrdersUpdate(dto);

            CheckErrors(resOrder2);
            var dto2 = resOrder2.Content;

            Assert.AreEqual(dto2.OrderNumber, TestConstants.TestOrder1Number);
            Assert.AreEqual(dto2.TotalGrand, TestConstants.TestOrder1TotalGrand);
        }
Esempio n. 2
0
        public CustomPropertyDTO ToDto()
        {
            CustomPropertyDTO dto = new CustomPropertyDTO();

            dto.Value       = this.Value;
            dto.Key         = this.Key;
            dto.DeveloperId = "bvc2004";
            return(dto);
        }
Esempio n. 3
0
        /// <summary>
        ///     Allows you to convert the current custom property object to the DTO equivalent for use with the REST API
        /// </summary>
        /// <returns>A new instance of CustomPropertyDTO</returns>
        public CustomPropertyDTO ToDto()
        {
            var dto = new CustomPropertyDTO();

            dto.Value       = Value;
            dto.Key         = Key;
            dto.DeveloperId = DeveloperId;

            return(dto);
        }
Esempio n. 4
0
 /// <summary>
 ///     Allows you to populate the current custom property object using a CustomPropertyDTO instance
 /// </summary>
 /// <param name="dto">An instance of the custom property from the REST API</param>
 public void FromDto(CustomPropertyDTO dto)
 {
     DeveloperId = dto.DeveloperId;
     Key         = dto.Key;
     Value       = dto.Value;
 }
Esempio n. 5
0
 public void FromDto(CustomPropertyDTO dto)
 {
     this.DeveloperId = dto.DeveloperId;
     this.Key         = dto.Key;
     this.Value       = dto.Value;
 }