public override void Execute(Command command)
        {
            var capacity = int.Parse(command.GetParams()[0]);
            var lot      = new Models.ParkingLot(capacity);

            _parkingLotService.CreateParkingLot(lot, new ParkingStrategy());
            Console.WriteLine("Created parking lot");
        }
예제 #2
0
        public void GivenHappyPath2_WhenAddingNewParkingLotToDb_ObjectIsAddedToDb()
        {
            using (var context = new ParkSharkDbContext(CreateNewInMemoryDatabase()))
            {
                var city = City.CreateCity(2050, "Antwerpen", "Belgium");

                var parkingLot = ParkingLotBuilder.CreateNewParkingLot()
                                 .WithName("test")
                                 .WithAddress(Address.CreateAddress("Parkinglotstraat", "20a", city))
                                 .WithContactPerson(ContactPerson.CreateNewContactPerson("Bas", "Adriaans", Address.CreateAddress("Contactpersoonstraat", "30", city), "*****@*****.**", "000000", ""))
                                 .WithCapacity(20)
                                 .WithDivision(Guid.NewGuid())
                                 .WithPricePerHour(4.5m)
                                 .Build();

                var service = new ParkingLotService(context);
                var result  = service.CreateParkingLot(parkingLot);

                Assert.Single(context.ParkingLots);
            }
        }