title: Writing a unit test for a semaphore?
body: <p>I've found a lot of questions on how to write tests for multithreaded code. They are mostly too abstract anyway and there are only a few examples of real tests. I came up with a more narrow question.</p>
  
  <p>How to write a good test for a semaphore in C#? Let's say a test for SemaphoreSlim implementation. It should cover the essence logic not the whole bunch of implementation details.</p>