Indivo Framework (iOS)
An iOS framework for Apps connecting to Indivo server
 All Classes Functions Variables Properties Pages
Instance Methods | Properties | List of all members
IndivoMockServer Class Reference

Mock Server to replace IndivoServer for unit testing. More...

#import <IndivoMockServer.h>

Inherits IndivoServer.

Instance Methods

(NSString *) - readFixture:
 
- Instance Methods inherited from IndivoServer
(void) - authenticate:
 Strips current credentials and then does the OAuth dance again. More...
 
(NSURL *) - authorizeCallbackURL
 The callback to feed to authorizeURL. More...
 
(void) - callDidFinish:
 Callback to let us know a call has finished. More...
 
(MPOAuthAPI *) - createOAuthWithAuthMethodClass:error:
 Creates a new MPOAuthAPI instance with our current settings. More...
 
(void) - fetchAppSpecificDocumentsWithCallback:
 Fetches global, app-specific documents. More...
 
(void) - performCall:
 Perform a method on our server This method is usally called by INServerObject subclasses, but you can use it bare if you wish. More...
 
(BOOL) - readyToConnect:
 
(IndivoRecord *) - recordWithId:
 Obviously returns the record with the given id, returns nil if it is not found. More...
 
(void) - selectRecord:
 This is the main authentication entry point, this method will ask the delegate where to present a login view controller, if authentication is necessary, and handle all user interactions until login was successful or the user cancels the login operation. More...
 
(BOOL) - shouldAutomaticallyAuthenticateFrom:
 Callback when the call is stuck at user authorization. More...
 
(void) - suspendCall:
 Dequeues a call without finishing it. More...
 

Properties

NSDictionary * mockMappings
 Two dimensional, first level is the method (GET, POST, ...), second a mapping path -> fixture.xml. More...
 
IndivoRecordmockRecord
 
- Properties inherited from IndivoServer
IndivoRecordactiveRecord
 The currently active record. More...
 
NSString * activeRecordId
 Shortcut method to get the id of the currently active record. More...
 
NSString * appId
 The id of the app as it is known on the server. More...
 
NSString * callbackScheme
 Defaults to "indivo-framework", but you can use your own. More...
 
NSString * consumerKey
 The consumer key for the app. More...
 
NSString * consumerSecret
 The consumer secret for the app. More...
 
id< IndivoServerDelegatedelegate
 A delegate to receive notifications. More...
 
NSMutableArray * knownRecords
 A cache of the known records on this server. Not currently used by the framework. More...
 
NSString * lastOAuthVerifier
 Storing our OAuth verifier here until MPOAuth asks for it. More...
 
BOOL storeCredentials
 NO by default. If you set this to YES, a successful login will save credentials to the system keychain. More...
 
NSURL * ui_url
 The UI-server URL (needed for login) More...
 
NSURL * url
 The server URL. More...
 

Additional Inherited Members

- Class Methods inherited from IndivoServer
(id) + serverWithDelegate:
 A convenience constructor creating the server for the given delegate. More...
 

Detailed Description

Mock Server to replace IndivoServer for unit testing.

When performing a call it parses the request URL and immediately calls the "didFinishSuccessfully:returnObject:" method, supplying data of the respective call if the request URL was understood by the mock server.

Method Documentation

- (NSString *) readFixture: (NSString *)  fileName

Property Documentation

- (NSDictionary*) mockMappings
readwritenonatomiccopy

Two dimensional, first level is the method (GET, POST, ...), second a mapping path -> fixture.xml.

- (IndivoRecord*) mockRecord
readwritenonatomicstrong

The documentation for this class was generated from the following files: