The benefit there is that you have to design your code to be testable to begin with.

If you decide later (once you have an idea of how to better design your code), to test after the fact, that's fine.

How to: Specify the Edit Mode for the Windows Forms Data Grid View Control Describes how to change the way users start editing cells.

datagridview cellvalidating value-55datagridview cellvalidating value-32datagridview cellvalidating value-31

control provides several features that let you change how users add or modify data in the control.

For example, you can make data entry more efficient by providing default values for new rows and by alerting users when errors occur.

(if you didn't know CRUD is short for Create, Read, Update, Delete.

It is the typical operations performed on set of data) You can then test the implementation of your Now with all the parts in place it is easy test that the View can request all the data.

I would like to refactor so that I can create unit tests to be able to test the logic that effects changing the back color of cells, and updating other cells.

The problem I am having is how to refactor logic to an external class, that has references to the winform controls.So, we've gotten all of the from outside of the form and injected it in. Well, we'll add some to the interface for the presenter to respond to. It catches the raised event, and interacts with the View's interface, performing this work.This means, that you can now relatively simply test your code. Moq makes it easy to mock out the view and test the presenter. Your Form (IParts View) needs to be with this pattern before trying to refactor to it with this monolithic code behind that you have there.You can easily select one of those bits of data (any row of your fake data), and perform what you need and want all in memory so you don't have to worry about connection strings, and setting up the tables correctly etc etc. from here you get the benefit of knowing your presenter populates your view with the correct data when needed.You can independently test the Real IPart Repository to make sure it is pulling data correctly.Reference | Product |Quantity |Price |Total |Total Bill AB |AB |2 |1000 |2000 |5000BC |BC |3 |1000 |3000 This is what I am trying to do...