Commits

Tuukka Norri  committed 646f068

The automatically updating collection now has its key and owner set

  • Participants
  • Parent commits 95754aa

Comments (0)

Files changed (1)

File UnitTests/Sources/BXModificationTests.m

 
 
 @implementation BXModificationTests
++ (BOOL) automaticallyNotifiesObserversForKey: (NSString *) key
+{
+	if ([key isEqualToString: @"collection"])
+		return NO;
+	else
+		return [super automaticallyNotifiesObserversForKey: key];
+}
+
+
 - (void) test1PkeyModification
 {    
     BXEntityDescription* pkeytest = [[mContext databaseObjectModel] entityForTable: @"Pkeytest"];
 	MKCAssertNotNil (entity);
 	
     NSError *error = nil;
-	NSArray *array = [mContext executeFetchForEntity: entity withPredicate: nil returningFaults: NO 
-								 updateAutomatically: YES error: &error];
-    STAssertNotNil (array, [error description]);
+	id res = [mContext executeFetchForEntity: entity 
+							   withPredicate: nil 
+							 returningFaults: NO 
+						 updateAutomatically: YES 
+									   error: &error];
+    STAssertNotNil (res, [error description]);
+	[res setOwner: self];
+	[res setKey: @"collection"];
+	
+	NSArray *array = res;
     NSUInteger count = [array count];
     
     //Create an object into the array using another connection.