public void test_transport()
 {
     //create instance of factory
     TransportFactory f = new TransportFactory();
     //create instance from factory
     Transport p = f.create("Transport");
     //check that it is right type
     Type t = new Transport().GetType();
     Assert.IsInstanceOfType(t, p);
 }
        public TradeableProperty TradeProperty(Player purchaser)
        {
            var transportFactory = new TransportFactory();

            TradeableProperty tradeableProperty = transportFactory.create("Railway Station");

            // The trader should be the banker as they own the property
            Trader trader = Banker.Access();

            trader.TradeProperty(ref tradeableProperty, ref purchaser, tradeableProperty.GetPrice(), Decimal.Zero);

            return tradeableProperty;
        }
        public void CreateProperties()
        {
            var resFactory = new ResidentialFactory();
            var transFactory = new TransportFactory();
            var utilFactory = new UtilityFactory();
            var genericFactory = new PropertyFactory();
            var luckFactory = new LuckFactory();


            try
            {
                var propertyDetails = _fileReader.ReadPropertyDetailsFromCSV();

                // Add the properties to the board
                foreach (var propertyDetail in propertyDetails)
                {
                    switch (propertyDetail.Type.ToLower())
                    {
                        case "luck":
                            Board.Access()
                                .AddProperty(luckFactory.create(propertyDetail.Name, propertyDetail.IsPenalty,
                                    propertyDetail.Amount));
                            break;
                        case "residential":
                            Board.Access()
                                .AddProperty(resFactory.create(propertyDetail.Name, propertyDetail.Price,
                                    propertyDetail.Rent, propertyDetail.HouseCost, propertyDetail.HouseColour));
                            break;
                        case "transport":
                            Board.Access().AddProperty(transFactory.create(propertyDetail.Name));
                            break;
                        case "utility":
                            Board.Access().AddProperty(utilFactory.create(propertyDetail.Name));
                            break;
                        case "generic":
                            Board.Access().AddProperty(genericFactory.Create(propertyDetail.Name));
                            break;
                    }
                }

                Console.WriteLine("Properties have been setup");
            }
            catch (Exception ex)
            {
                Console.WriteLine("Oops, something went wrong setting up the properties: {0}", ex.Message);
            }
        }