G
Greg Roberts
Hi
I want to place the tests needed in the code using attributes. There seems
to be enough code snippets around
for me to cover this. e.g.
// Test cases, run these here on the function and check the result
[Test, Function=CheckType, Args="-1,3,'flower'", Result=true]
[Test, Function=CheckType, Args="5,3,'pot'", Result=true]
[Test, Function=CheckType, Args="99,3,'men'", Result=false]
// Function
static Boolean CheckType(int FirstArg, int SecondArg, string sType)
{
// Code in here
...
return bResult;
}
The harder part is i want to use reflection to establish the function
arguments and create on the
stack these arguments with the correct values and then call the function
trapping the returned value .
This would be fantastic as nolonger would 2 sets of code need to be
maintained, i.e. the original
functions then the test cases which exercised these functions.
The test for the function lives with the function .
C# begineer
Thanks in advance
I want to place the tests needed in the code using attributes. There seems
to be enough code snippets around
for me to cover this. e.g.
// Test cases, run these here on the function and check the result
[Test, Function=CheckType, Args="-1,3,'flower'", Result=true]
[Test, Function=CheckType, Args="5,3,'pot'", Result=true]
[Test, Function=CheckType, Args="99,3,'men'", Result=false]
// Function
static Boolean CheckType(int FirstArg, int SecondArg, string sType)
{
// Code in here
...
return bResult;
}
The harder part is i want to use reflection to establish the function
arguments and create on the
stack these arguments with the correct values and then call the function
trapping the returned value .
This would be fantastic as nolonger would 2 sets of code need to be
maintained, i.e. the original
functions then the test cases which exercised these functions.
The test for the function lives with the function .
C# begineer
Thanks in advance