コード例 #1
0
        public void NormalToNullables()
        {
            var promotion      = new Promotion {
            };
            var promotionInput = new PromotionInput();

            promotionInput.InjectFrom <NormalToNullables>(promotion);


            Assert.AreEqual(null, promotionInput.Start);
        }
コード例 #2
0
        public void EntitiesToIntsTest()
        {
            var promotion = new cm.Promotion {
                Products = new List <cm.Product> {
                    new cm.Product {
                        Id = 3
                    }, new cm.Product {
                        Id = 7
                    }
                }
            };

            var promotionInput = new PromotionInput();

            promotionInput.InjectFrom <EntitiesToInts>(promotion);

            Assert.IsNotNull(promotionInput.Products);
            Assert.AreEqual(2, promotionInput.Products.Count());
            Assert.AreEqual(3, promotionInput.Products.First());
        }