コード例 #1
0
        public void BikeFacadeReturnsProperBikeTest()
        {
            var bikeFacade = new BikeFacade();
            var bike       = bikeFacade.CreateBike(1997, "Audi", 300, 300, Guid.NewGuid(), Color.Pink);

            Assert.AreEqual(bike.ProductionYear, 1997);
            Assert.AreEqual(bike.Brand, "Audi");
            Assert.AreEqual(bike.KerbWeight, 300);
            Assert.AreEqual(bike.MaxVelocity, 300);
            Assert.AreEqual(bike.Color, Color.Pink);
        }
コード例 #2
0
        private static void FacadePatternDemo()
        {
            BikeFacade facade = new BikeFacade();

            facade.PrepareForSale(new Downhill(BikeColor.Red, new Widewheel(20)));
        }