コード例 #1
0
 public void AvailabilityTest()
 {
     var car = new Car(avto, 3);
     car.Cost = 2000;
     car.MaximumNumberOfPassengers = 3;
     Assert.AreEqual(car.Availability,true);
 }
コード例 #2
0
 public void SearchCarTest()
 {
     var car = new Car(avto, 0);
     car.Name = "asd";
     car.Cost = 2000;
     car.MaximumNumberOfPassengers = 3;
     Assert.AreEqual(car, avto.SearchCar("asd"));
 }
コード例 #3
0
 public void PurchaserNameExceptionTest()
 {
     var car = new Car(avto, 0);
     car.Name = "asd";
     car.Cost = 2000;
     car.MaximumNumberOfPassengers = 3;
     Applications app = new UIApplicationsForDelayedDelivery("", car, 20);
 }
コード例 #4
0
 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();
 }
コード例 #5
0
 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);
 }
コード例 #6
0
 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);
 }
コード例 #7
0
 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("Неуказаны необходимые поля.");
     }
 }
コード例 #8
0
 public UIApplicationsInStock(String nameOfBuyer, Car car)
     : base(nameOfBuyer, car)
 {
 }
コード例 #9
0
ファイル: MainForm.cs プロジェクト: xjMavericKjx/AutosaloonC
 private void UpdateApplicationListBox(Car car)
 {
     ApplicationListBox.Items.Clear();
     foreach (var application in car.GetApplications())
     {
         ApplicationListBox.Items.Add(application);
     }
 }
コード例 #10
0
 public CreateApplicationForm(Car car)
 {
     _car = car;
     InitializeComponent();
 }
コード例 #11
0
 public UIApplicationsForDelayedDelivery(string nameOfBuyers,Car car,int percent)
     : base(nameOfBuyers,car)
 {
     SalePercent = percent;
 }
コード例 #12
0
 public void RemoveCar(Car car)
 {
     _cars.Remove(car);
 }
コード例 #13
0
 public void AddCar(Car car)
 {
     _cars.Add(car);
 }