2
I don't think you need to test everything around opening the input file, closing it, handling exceptions, etc. For the purpose of this task, I believe you want to test your logic, and trust that FileReader or FileInputStream etc just work.
I would have a class that that can read the format of the dictionary (not provided, presumably this is ...
2
Make your code return a Task. Even if you don't await it in the program doesn't mean you can't await it in your test. Also pass in a TimeSpan instead of int for seconds.
public async static Task CancelAfter(TimeSpan delay, CancellationToken token, Action action)
The Task.Delay takes a TimeSpan as an option. Reading code using the TimeSpan Factories is ...
Only top voted, non community-wiki answers of a minimum length are eligible
Related Tags
unit-testing × 994c# × 249
python × 189
java × 188
javascript × 90
object-oriented × 56
beginner × 52
python-3.x × 51
php × 43
mocks × 43
ruby × 41
junit × 40
programming-challenge × 39
c++ × 37
algorithm × 36
performance × 32
interview-questions × 32
strings × 31
design-patterns × 29
c × 26
nunit × 24
node.js × 23
linked-list × 22
.net × 20
dependency-injection × 19