public void NoVehicleFound()
        {
            var licensePlate = "AA1111AA";

            _parkVehicle = new VehicleParkTestMock(2, 3, new DataRepository());

            _parkVehicle.FindVehicle(licensePlate);
        }
        public void VehicleFound()
        {
            var licensePlate = "AA1111AA";
            var owner        = "DrHouse";

            var mock = new Mock <IDataRepository>();

            mock.Setup(m => m.FindVehicle(It.IsAny <string>()))
            .Returns((string lp) => new Vehicle(RateConstants.CAR_REGULAR_RATE, RateConstants.CAR_OVERTIME_RATE,
                                                VehicleType.Car, lp, owner, 1, DateTime.UtcNow, 1, 1));

            _parkVehicle = new VehicleParkTestMock(2, 3, mock.Object);

            var result = _parkVehicle.FindVehicle(licensePlate);

            Assert.IsNotNull(result);
            Assert.AreEqual(licensePlate, result.LicensePlate);
        }
        public void HasCarForOwner()
        {
            var licensePlate = "AA1111AA";
            var owner        = "DrHouse";

            var mock = new Mock <IDataRepository>();

            mock.Setup(m => m.FindVehiclesByOwner(It.IsAny <string>()))
            .Returns((string ow) => new List <IVehicle>
            {
                new Vehicle(RateConstants.CAR_REGULAR_RATE, RateConstants.CAR_OVERTIME_RATE, VehicleType.Car,
                            licensePlate, ow, 1, DateTime.UtcNow, 1, 1)
            });

            _parkVehicle = new VehicleParkTestMock(2, 3, mock.Object);

            var result = _parkVehicle.FindVehiclesByOwner(owner);

            Assert.IsNotNull(result);
            Assert.AreEqual(1, result.Count);
            Assert.AreEqual(licensePlate, result[0].LicensePlate);
        }
 public void Initialize()
 {
     _parkVehicle = new VehicleParkTestMock(3, 5, new DataRepository());
 }