lets say i have a background worker in a class that perform db query in a background thread.
i wanna test this class
so i mock my db and return some collection so far so good, make sure my background worker called the do work and than i wanna make sure that the finish also happened.
I've noticed that the test pass and fail randomly (i think it has something to do with threads)
any suggestions