Re: Asynchronous Unit testing
Re: Asynchronous Unit testing
- Subject: Re: Asynchronous Unit testing
- From: Mike Zornek <email@hidden>
- Date: Wed, 08 Feb 2006 10:53:58 -0500
On 2/8/06 9:09 AM, "Ruotger Skupin" <email@hidden> wrote:
> Hi,
>
> I hope this is the right list to ask...
>
> I'd like to unit test some code that relies heavily on timers and calls like
> [[NSNotificationQueue defaultQueue] enqueueNotification:[NSNotification
> notificationWithName:kSomeNotification object:self]
> postingStyle:NSPostWhenIdle];
>
> i.e. my -(void) testSomething method returns immediately and actual test will
> run some time later. Is that possible at all with the SenTestingKit?
>
> Roddi
I did some unit testing on a web spider I wrote. Had the same issue .. I
wasn't sure when it would be done. Here's my code:
[websiteScanner startScan];
while ([websiteScanner isDoneProcessing] == NO) {
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate
dateWithTimeIntervalSinceNow:1.0]];
NSLog(@"Polling...");
}
After that I would do all of my asserts.
~ Mike
--
Work: http://ClickableBliss.com
Play: http://MikeZornek.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden