Reputation: 18117
Is it possible to execute code quick test in VS2010?
For example I would like to test code below just selecting it in code editor and execute it by passing variables?
public static int GetInt(object value)
{
int result;
Int32.TryParse(GetString(value), out result);
return result;
}
I know about Immediate Window but it does not always works and not all code can be tested with it.
Upvotes: 1
Views: 105
Reputation: 165
There is an extension for Visual Studio 2010 called Code Scrap which, according to the developer, "Adds a window for writing and executing scraps of code within Visual Studio."
Upvotes: 0
Reputation: 2789
Try one of these tools:
Upvotes: 1
Reputation: 1038930
You could do this by running the corresponding unit test you wrote before implementing the method. This will ensure that the implementation you just wrote conforms to the expected results you defined in the unit test.
Upvotes: 1