コード例 #1
0
 public void TestMethod21()
 {  // оперция 2
     l.Mass = new int[] { 4, -4, 5, -5, 6, -6, 7, -7, 8, -8 };
     l.Oper2();
     Array.Sort(l.Mass);
     for (int i = 0; i < l.MassAft.Length; i++)
     {
         Assert.True(l.MassAft[i] == l.Mass[i]);
     }
 }
コード例 #2
0
ファイル: Form1.cs プロジェクト: VladislavaT/SummerPractise
 private void button6_Click(object sender, EventArgs e)
 {     // кнопка выполнить
     if (radioButton1.Checked)
     { // 1 операция
         l.Oper1(Convert.ToInt32(numericUpDown5.Value));
         textBox2.Text = "Sum(<C) = " + l.Summ1 + "   Sum(>C) = " + l.Summ2;
     }
     else if (radioButton2.Checked)
     { // 2 операция
         l.Oper2();
         textBox2.Text = null;
         for (int i = 0; i < l.MassAft.Length; i++)
         {
             if (i == l.MassAft.Length - 1)
             {
                 textBox2.Text += l.MassAft[i];
             }
             else
             {
                 textBox2.Text += l.MassAft[i] + ", ";
             }
         }
     }
     else if (radioButton3.Checked)
     { // 3 операция
         l.Oper3(Convert.ToInt32(numericUpDown5.Value), Convert.ToInt32(numericUpDown4.Value));
         textBox2.Text = "Sum = " + l.Summ1 + "     Колличество: " + l.Num;
     }
     else
     {// 4 операция
         l.Oper4();
         textBox2.Text = $"Sr =  {l.Sr:0.##}     D =  {l.D:0.##}";
     }
     button4.Enabled   = true;
     groupBox3.Enabled = true;
 }