Skip to content

Commit

Permalink
Improving the code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomelli committed Sep 11, 2022
1 parent 2644b9c commit 6f89736
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,5 +217,31 @@ public void Start_MaxThreads1_DoNotBlockOtherThreads()
otherThread.Stop();
Assert.GreaterOrEqual(otherThreadCount, 2);
}

[Test]
public void Stop_Before_Start()
{
var pipeline = "";
var target = new TplTaskExecutor();
target.Add(() =>
{
pipeline += "1";
});
target.Add(() =>
{
Thread.Sleep(100);
pipeline += "2";
});
target.Add(() =>
{
Thread.Sleep(10);
pipeline += "3";
});

target.Stop();
var actual = target.Start();
Assert.IsTrue(actual);
Assert.AreEqual("132", pipeline);
}
}
}

0 comments on commit 6f89736

Please sign in to comment.