Is it possible for visual studio to create a unit test with the parameters that are passed into a method? For example I have a method with this signature:
internal static IEnumerable<Asset> GetAssetsToBuy(Dictionary<string, Asset> assets, string selectedPortfolio, string selectedAllocation)
{
throw new NotImplementedException();
}
This method was just added to an existing application that collects data from a service, formats it, then calls this method to perform a calculation on it. It would be useful to be able to start developing this new feature by creating a unit test. Is there any way to extract those values to the unit test?
Edit:
I don't think this question is clear as stated. What I'd like to do it get the values at runtime, but copy them to the unit test. For example if I use Newtonsoft.Json and serialize assets
then in the unit test add the serialized string as a constant and deserialize it in the test. I'm wondering if there is a way to do this without serializing the values.
Duplicate of Debugger Visualizer to generate Object Initializer code