コード例 #1
0
        public void TestMethod42()
        { // оперция 4
            l.Mass = new int[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
            l.Oper4();
            string Tmp = $"{l.Sr:0.##}";

            Assert.True(Tmp == "1");
            Tmp = $"{l.D:0.##}";
            Assert.True(Tmp == "0");
        }
コード例 #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;
 }