public void AvailabilityTest() { var car = new Car(avto, 3); car.Cost = 2000; car.MaximumNumberOfPassengers = 3; Assert.AreEqual(car.Availability,true); }
public void SearchCarTest() { var car = new Car(avto, 0); car.Name = "asd"; car.Cost = 2000; car.MaximumNumberOfPassengers = 3; Assert.AreEqual(car, avto.SearchCar("asd")); }
public void PurchaserNameExceptionTest() { var car = new Car(avto, 0); car.Name = "asd"; car.Cost = 2000; car.MaximumNumberOfPassengers = 3; Applications app = new UIApplicationsForDelayedDelivery("", car, 20); }
public void CarNumberExceptionTest() { var car = new Car(avto,0); car.Name = "asd"; car.Cost = 2000; car.MaximumNumberOfPassengers = 3; Applications app = new UIApplicationsForDelayedDelivery("asd",car,20); app.СalculateCost(); }
public void CalculateCostTest() { var car = new Car(avto, 3); car.Cost = 2000; car.MaximumNumberOfPassengers = 3; Applications app = new UIApplicationsForDelayedDelivery("asd", car, 20); app.СalculateCost(); Assert.AreEqual(app.СalculateCost(),1600); }
protected Applications(string nameOfBuyer,Car car) { try { if (string.IsNullOrEmpty(nameOfBuyer)) throw new PurchaserNameException("Неуказано имя покупателя!"); NameOfBuyer = nameOfBuyer; } catch (PurchaserNameException ex) { MessageBox.Show("" + ex); } Car = car; Car.AddApplication(this); }
private void CreateCarButton_Click(object sender, EventArgs e) { if (!String.IsNullOrEmpty(CarNameTextBox.Text) && !String.IsNullOrEmpty(CostTextBox.Text) && !String.IsNullOrEmpty(NumberOfPassegerTextBox.Text)) { Car = new Car(_saloon, Convert.ToInt32(QuantityInStockTextBox.Text)) { Name = CarNameTextBox.Text, MaximumNumberOfPassengers = Convert.ToInt32(NumberOfPassegerTextBox.Text), Cost = Convert.ToInt32(CostTextBox.Text) }; DialogResult = DialogResult.OK; Close(); } else { MessageBox.Show("Неуказаны необходимые поля."); } }
public UIApplicationsInStock(String nameOfBuyer, Car car) : base(nameOfBuyer, car) { }
private void UpdateApplicationListBox(Car car) { ApplicationListBox.Items.Clear(); foreach (var application in car.GetApplications()) { ApplicationListBox.Items.Add(application); } }
public CreateApplicationForm(Car car) { _car = car; InitializeComponent(); }
public UIApplicationsForDelayedDelivery(string nameOfBuyers,Car car,int percent) : base(nameOfBuyers,car) { SalePercent = percent; }
public void RemoveCar(Car car) { _cars.Remove(car); }
public void AddCar(Car car) { _cars.Add(car); }