static void Main(string[] args) { RequestWorker requestworker = new RequestWorker(new RequestRepository()); requestworker.Start(3, 3); Thread.Sleep(30000); requestworker.Stop(); }
public void Test() { var repositoryStub = new RequestRepositoryStub(); var worker = new RequestWorker(repositoryStub); worker.Start(12, 56); Thread.Sleep(5000); worker.Stop(); Assert.Equal(repositoryStub.Requested, repositoryStub.Processed + repositoryStub.Deleted); }