diff options
author | Matt Ronge <mronge@mronge.com> | 2013-02-01 13:04:48 -0600 |
---|---|---|
committer | Matt Ronge <mronge@mronge.com> | 2013-02-01 13:04:48 -0600 |
commit | 64ea14666f89fe4aac3beea7699d3af233710cfb (patch) | |
tree | 18ccb679517bd1a319f136107ea641e9864a82f4 /tests | |
parent | cd68ceb0f17eca3e6d4acabae448b8d79f735a8d (diff) |
Implemented fetch folders in Obj-C wrapper
Diffstat (limited to 'tests')
-rw-r--r-- | tests/main.mm | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/tests/main.mm b/tests/main.mm index fe1efb2e..87f44fa4 100644 --- a/tests/main.mm +++ b/tests/main.mm @@ -273,14 +273,26 @@ static void testAsyncPOP() void testObjc() { MCOIMAPSession *session = [[MCOIMAPSession alloc] init]; - session.username = @"username"; - session.password = @"password"; + session.username = @"monkeybreadr@gmail.com"; + session.password = @""; session.hostname = @"imap.gmail.com"; session.port = 993; session.connectionType = MCOConnectionTypeTLS; - [session checkAccount:^(NSError *err, MCOOperation *op, id result) { - NSLog(@"CONNECTED? %@", err); + [session checkAccount:^(NSError *err, MCOOperation *op, id response) { + if (err) { + NSLog(@"Oh crap, an error %@", err); + } else { + NSLog(@"CONNECTED"); + } + }]; + + [session fetchAllFolders:^(NSError *err, MCOOperation *op, id response) { + if (err) { + NSLog(@"Oh crap, an error %@", err); + } else { + NSLog(@"Folder %@", response); + } }]; [[NSRunLoop currentRunLoop] run]; |