示例#1
0
        public void BuildCar()
        {
            TeslaBuilder builder = new TeslaBuilder();

            _director.Construct(builder);
            Console.WriteLine("Tesla Sport Car");
        }
示例#2
0
        public void CarBuilderTest()
        {
            //arrange
            Car expectedResult =
                new Car()
            {
                FuelType  = Fuel.Solar,
                MaxSpeed  = 201,
                SeatCount = 2
            };
            Car result = null;

            //act

            var builder = new TeslaBuilder();

            builder.SetFuel();
            builder.SetMaxSpeed();
            builder.SetSeatCount();
            result = builder.GetCar;

            //assert
            Assert.AreEqual(expectedResult, result);
        }