示例#1
0
        private List <IComponent> DummyCarComponents()
        {
            var componentFactory   = new ComponentFactory("car");
            var dummyCarComponents = componentFactory.CreateComponents();

            return(dummyCarComponents);
        }
示例#2
0
        public List <IComponent> DummyPlaneComponents()
        {
            var componentFactory     = new ComponentFactory("plane");
            var dummyPlaneComponents = componentFactory.CreateComponents();

            return(dummyPlaneComponents);
        }
示例#3
0
        public void WhenComponentFactoryIsCalledWithVehicleTypeofCarParameter_ThenAListOfComponentObjectsIsReturned(
            string vehicleType)
        {
            var componentFactory = new ComponentFactory(vehicleType);
            var expected         = DummyCarComponents();
            var result           = componentFactory.CreateComponents();
            int i = 0;

            foreach (IComponent component in result)
            {
                component.Should().Be(result[i]);
                i++;
            }
        }