private void Toprecipegrid_CellClick(object sender, DataGridViewCellEventArgs e) { try { if (toprecipegrid.Rows[e.RowIndex].Cells[e.ColumnIndex].Value != null) { toprecipegrid.CurrentRow.Selected = true; textBox10.Text = toprecipegrid.Rows[e.RowIndex].Cells["Product Name"].FormattedValue.ToString(); textBox9.Text = toprecipegrid.Rows[e.RowIndex].Cells["Instructions"].FormattedValue.ToString(); label23.Text = toprecipegrid.Rows[e.RowIndex].Cells["Number"].FormattedValue.ToString(); VoteRecipe takevotes = new VoteRecipe(); int positive = takevotes.Takepositivevotes(label23.Text); int negative = takevotes.Takenegativevotes(label23.Text); label24.Text = positive.ToString(); label25.Text = negative.ToString(); } } catch (Exception) { } }
public void VotePositive() { VoteRecipe VotePositive = new VoteRecipe(); Assert.That(VotePositive.Takepositivevotes("1"), Is.EqualTo(0), "Some useful error message"); }