I have class which have one public method Start
, one private method and one event Finishing
. Start
call new Thread( private_method )
NUnit has built-in feature for waiting for assertion. It is called 'After':
[Test]
public void ShouldRaiseFinishedEvent()
{
SomeClass someObject = new SomeClass();
bool eventRaised = false;
someObject.SomethingFinished += (o, e) => { eventRaised = true; };
someObject.DoSomething();
Assert.That(eventRaised, Is.True.After(500));
}