public void TestSumNArray() { KPO.Math ss = new KPO.Math(); int[] array = { 10, 10, 10, 10 }; int test = ss.SumOfAvgArray(array); Assert.AreEqual(test, 10); }
private void button2_Click(object sender, EventArgs e) { KPO.Math izračuni = new KPO.Math(); try { Convert.ToInt32(textBox2.Text); Convert.ToInt32(textBox3.Text); Convert.ToInt32(textBox4.Text); } catch { MessageBox.Show("Napačne vrednosti!"); return; } int[] items = new int[3]; items[0] = Convert.ToInt32(textBox2.Text); items[1] = Convert.ToInt32(textBox3.Text); items[2] = Convert.ToInt32(textBox4.Text); var result = izračuni.SumOfAvgArray(items); label4.Text = "Vrednost je " + result; }