Error while creating tests in Visual Studio
Posted
by Benjol
on Stack Overflow
See other posts from Stack Overflow
or by Benjol
Published on 2009-08-19T11:57:22Z
Indexed on
2010/06/06
18:02 UTC
Read the original article
Hit count: 483
visual-studio-2008
|unit-testing
When I try to generate a unit test for the following method (in a public static class)
private static string[] GetFields(string line, char sep)
{
char[] totrim = { '"', ' ' };
return line.Split(sep).Select(col => col.Trim(totrim)).ToArray();
}
The Tests output says:
While trying to generate your tests, the following errors occurred:
This method or property cannot be called within an event handler.
It works if I make the function public - I've tried running Publicize.exe manually, it doesn't complain, but doesn't make any difference either.
© Stack Overflow or respective owner