public void CalculateForSelectedButton_OneSelected_CallsCalculateHandleCalculateSelectedObjects()
        {
            // Setup
            TestCalculationsView view = ShowFullyConfiguredTestCalculatableView();

            DataGridView dataGridView = ControlTestHelper.GetDataGridView(testForm, "DataGridView");

            DataGridViewRowCollection rows = dataGridView.Rows;

            rows[0].Cells[calculateColumnIndex].Value = true;

            var buttonTester = new ButtonTester("CalculateForSelectedButton", testForm);

            // Call
            buttonTester.Click();

            // Assert
            Assert.AreEqual(1, view.ObjectsToCalculate.Count());
            TestCalculatableObject expectedObject = ((IEnumerable <TestCalculatableObject>)view.Data).First();

            Assert.AreEqual(expectedObject, view.ObjectsToCalculate.First());
        }
Example #2
0
 public TestCalculatableRow(TestCalculatableObject calculatableObject) : base(calculatableObject)
 {
     ShouldCalculate = calculatableObject.IsChecked;
 }