Since you mentioned that you are new, I will add a reminder here that you need to be careful with what you are testing. You want to test your logic, not windows. To do this, you need to separate your problems into a class (or classes) that contain your logic, and classes that contain wrappers (proxies) for the APIs you use - you do not check the API. They work until you prove otherwise.
, . , , , Windows API , , WindowsProxy, , , .
.NET Windows-Forms - , , , MVP. , Presenter, ( ) ( API , ).
:
public interface IView { ... }
public class View : IView
{
private Presenter _p;
View()
{
_p = new Presenter(this);
...
}
}
public class Presenter
{
presenter IView _v;
Presenter(IView view)
{
_v = view;
}
}
, Moq, ( ). Moq , (, ).
, . Win-Form TDD. , .
, .
.