I'm working on a project that utilizes Quartz.NET for job scheduling. I've implemented some tests using NUnit.Framework to verify the proper functioning of my scheduler. However, I'm encountering an issue with the auto-increment of a trigger during the tests.
Here's my scenario: I have a trigger that should perform a certain action (e.g., incrementing from 0 to 5) each time it's fired. In my production code, the trigger works correctly, and the auto-increment occurs as expected.
However, when I run NUnit tests to validate the trigger's behavior, it seems that the trigger doesn't get properly activated, and the auto-increment gets stuck during the thread sleep. It appears as if the trigger isn't "seen" or handled during the tests.
What could be the possible reasons for this behavior during NUnit tests? What advice or suggestions do you have to ensure that the trigger functions correctly even during testing?
Thank you in advance for your assistance!
The solution was based on the fact that I was calling IDispose
for each test, which was deleting everything. The specific issue was _webHost.Dispose();
and also the fact that I wasn't using Thread.Sleep()
.