Esempio n. 1
0
 /// <summary>
 /// Обработчик нажатия кнопки создания набора случайных записей
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void CreateRandomListButton_Click(object sender, EventArgs e)
 {
     Random random = new Random();
     for (int i = 0; i < 10; i++)
     {
         int intTypeRandomizer = random.Next(3);
         switch (intTypeRandomizer)
         {
             case 0:
                 Run run = new Run(random.Next(11), random.Next(1000));
                 itemList.Add(run);
                 break;
             case 1:
                 Swim swim = new Swim(random.Next(3), random.Next(1000));
                 itemList.Add(swim);
                 break;
             case 2:
                 Press press = new Press(random.Next(100), random.Next(20));
                 itemList.Add(press);
                 break;
         }
     }
     UpdateDataGridView();
 }
Esempio n. 2
0
 public void PositiveDistanceTest(double distance)
 {
     var run = new Run(10, distance);
 }
Esempio n. 3
0
 public void PositiveIntensivityTest(double intensivity)
 {
     var run = new Run(intensivity, 10);
 }
Esempio n. 4
0
 public double CalculateCaloriesTest(double intensivity, double distance)
 {
     var run = new Run(intensivity, distance);
     return run.CalculateCalories();
 }