I'm trying to write a unit test for function but I need to initiate some variables before testing it.
The function that I need to test has a parameter Task<List<string>> list
I want to initiate this variable.
Here is what I've tried so far:
Task<List<string>> list = new List<string>();
If you just want Task with empty List of string, you could call Task.FromResult like this:
Task<List<string>> list = Task.FromResult(new List<string>());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With