Esempio n. 1
0
        public void LawnmowerToProduct()
        {
            var id        = Guid.NewGuid();
            var lawnMower = new Lawnmower
            {
                Id             = id,
                Name           = "Briggs & Stratton",
                Price          = 42.0,                                  //FIXME: Prices REALLY should have been Decimal not Double...
                FuelEfficiency = "Average",
                IsVehicle      = false
            };


            var product = lawnMower.ToProduct();

            Assert.AreEqual(lawnMower.Id, product.Id, "ID mismatch!");
            Assert.AreEqual(lawnMower.Name, product.Name, "Name mismatch!");
            Assert.AreEqual(lawnMower.Price, product.Price, "Price mismatch!");
            Assert.AreEqual("Lawnmower", product.Type, "Type mismatch!");
        }