Example #1
0
            public void Can_Serialize_And_Deserialize_A_ProductAttribute()
            {
                var att     = new ProductAttribute("test", "test") as IProductAttribute;
                var display = att.ToProductAttributeDisplay();

                var serialized = JsonConvert.SerializeObject(display);


                var deserialized = JsonConvert.DeserializeObject <ProductAttributeDisplay>(serialized);

                Assert.NotNull(deserialized);
            }
Example #2
0
            public void Can_Serialize_And_Deserialize_A_ProductAttributeWithDetachedValues()
            {
                var att = new ProductAttribute("test", "test") as IProductAttribute;

                att.DetachedDataValues.AddOrUpdate("key", "value", (x, y) => "value");
                var display = att.ToProductAttributeDisplay();

                var serialized = JsonConvert.SerializeObject(display);


                var deserialized = JsonConvert.DeserializeObject <ProductAttributeDisplay>(serialized);

                Assert.NotNull(deserialized);
            }