The following class has a method that calls the ReportProgress
method of a 'BackgroundWorker`:
public class Project
{
protected System.ComponentModel.BackgroundWorker worker;
public void progress(int percentage)
{
if (worker != null)
worker.ReportProgress(percentage);
}
}
How to go about testing the progress
method? The aim would be to test that the worker method has its ReportProgress
method called with the correct argument. Correct me if this approach is wrong.
What has been tried is using FakeItEasy to create a fake of the BackgroundWorker
, but that yields the error: "non virtual methods can not be intercepted".