OnPaint

OnPaint

We have a test machine setup to run unattended NUnit based GUI tests, from which we generate a coverage info. What we are seeing is that if someone logs into the machine or remote-desktops into the machine while the test is running, the coverage data shows the hits in OnPaint method. But if the machine is locked while the tests is running (which is the norm) the coverage data does not show any hits in the OnPaint method.

Although this kinda makes sense, it's inconvenient for me to log into the machine while the test is running (the whole point is to get the coverage data automatically). Is there a way (in NCover) to make OnPaint actually want to draw (like a fake GUI user mode or something)? Any help is appreciated.


RE: OnPaint

c-shan,

OnPaint is called by the OS. Since nobody is logged in, the UI never draws and the OnPaint event never fires.

I would write a unit test that forces the OnPaint Event to be called.

Joe Feser