Ported RestKit tests over to using the RKTestFactory and completed documentation. fixes #318

This commit is contained in:
Blake Watters
2012-03-15 23:06:49 -04:00
parent a84f52376a
commit 868372272f
27 changed files with 327 additions and 370 deletions

View File

@@ -28,7 +28,7 @@
@implementation RKInMemoryEntityCacheTest
- (void)testShouldCoercePrimaryKeysToStringsForLookup {
RKManagedObjectStore* objectStore = [RKTestFactory objectStore];
RKManagedObjectStore* objectStore = [RKTestFactory managedObjectStore];
RKHuman* human = [RKHuman createEntity];
human.railsID = [NSNumber numberWithInt:1234];
[objectStore save:nil];
@@ -38,7 +38,7 @@
}
- (void)testShouldCacheAllObjectsForEntityWhenAccessingEntityCache {
RKManagedObjectStore* objectStore = [RKTestFactory objectStore];
RKManagedObjectStore* objectStore = [RKTestFactory managedObjectStore];
RKHuman* human = [RKHuman createEntity];
human.railsID = [NSNumber numberWithInt:1234];
[objectStore save:nil];
@@ -54,7 +54,7 @@
}
- (void)testShouldCacheAllObjectsForEntityWhenAsked {
RKManagedObjectStore* objectStore = [RKTestFactory objectStore];
RKManagedObjectStore* objectStore = [RKTestFactory managedObjectStore];
RKHuman* human = [RKHuman createEntity];
human.railsID = [NSNumber numberWithInt:1234];
[objectStore save:nil];
@@ -71,7 +71,7 @@
}
- (void)testShouldRetrieveObjectsProperlyFromTheEntityCache {
RKManagedObjectStore* objectStore = [RKTestFactory objectStore];
RKManagedObjectStore* objectStore = [RKTestFactory managedObjectStore];
RKHuman* human = [RKHuman createEntity];
human.railsID = [NSNumber numberWithInt:1234];
[objectStore save:nil];
@@ -87,7 +87,7 @@
}
- (void)testShouldCacheAnIndividualObjectWhenAsked {
RKManagedObjectStore* objectStore = [RKTestFactory objectStore];
RKManagedObjectStore* objectStore = [RKTestFactory managedObjectStore];
RKHuman* human = [RKHuman createEntity];
human.railsID = [NSNumber numberWithInt:1234];
[objectStore save:nil];
@@ -113,7 +113,7 @@
}
- (void)testShouldCacheAnIndividualObjectByPrimaryKeyValueWhenAsked {
RKManagedObjectStore* objectStore = [RKTestFactory objectStore];
RKManagedObjectStore* objectStore = [RKTestFactory managedObjectStore];
RKHuman* human = [RKHuman createEntity];
human.railsID = [NSNumber numberWithInt:1234];
[objectStore save:nil];
@@ -143,7 +143,7 @@
}
- (void)testShouldExpireACacheEntryForAnObjectWhenAsked {
RKManagedObjectStore* objectStore = [RKTestFactory objectStore];
RKManagedObjectStore* objectStore = [RKTestFactory managedObjectStore];
RKHuman* human = [RKHuman createEntity];
human.railsID = [NSNumber numberWithInt:1234];
[objectStore save:nil];
@@ -162,7 +162,7 @@
}
- (void)testShouldExpireEntityCacheWhenAsked {
RKManagedObjectStore* objectStore = [RKTestFactory objectStore];
RKManagedObjectStore* objectStore = [RKTestFactory managedObjectStore];
RKHuman* human = [RKHuman createEntity];
human.railsID = [NSNumber numberWithInt:1234];
[objectStore save:nil];
@@ -182,7 +182,7 @@
#if TARGET_OS_IPHONE
- (void)testShouldExpireEntityCacheInResponseToMemoryWarning {
RKManagedObjectStore* objectStore = [RKTestFactory objectStore];
RKManagedObjectStore* objectStore = [RKTestFactory managedObjectStore];
RKHuman* human = [RKHuman createEntity];
human.railsID = [NSNumber numberWithInt:1234];
[objectStore save:nil];
@@ -202,7 +202,7 @@
#endif
- (void)testShouldAddInstancesOfInsertedObjectsToCache {
RKManagedObjectStore* objectStore = [RKTestFactory objectStore];
RKManagedObjectStore* objectStore = [RKTestFactory managedObjectStore];
RKHuman* human = [RKHuman createEntity];
human.railsID = [NSNumber numberWithInt:1234];
[objectStore save:nil];
@@ -227,7 +227,7 @@
}
- (void)testShouldRemoveInstancesOfDeletedObjectsToCache {
RKManagedObjectStore* objectStore = [RKTestFactory objectStore];
RKManagedObjectStore* objectStore = [RKTestFactory managedObjectStore];
RKHuman* humanOne = [RKHuman createEntity];
humanOne.railsID = [NSNumber numberWithInt:1234];