コード例 #1
0
 public void TestMethod11()
 {  // оперция 1
     l.Mass = new int[] { 12, 6, -6, 15, 25, 6, -6, 23, 28, 16 };
     l.Oper1(5);
     Assert.True(l.Summ1 == 0);
     Assert.True(l.Summ2 == 66);
 }
コード例 #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;
 }