Created
July 2, 2015 07:16
-
-
Save DevAlloy/438405e7dfd007784317 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)testFeedMapperStrongParentChildClustersRelations { | |
// given | |
NSInteger expectedCountOfRootClusters = 10; | |
// when | |
[self.clusterIdsMapper mapServerResponse:self.regularServerResponse mappingContext:@{RDNMapperClustersTopicNameKey : RDNFirstTopicIdentifier}]; | |
NSArray *cachedClustersArray = [RDNCluster MR_findAll]; | |
// then | |
NSMutableSet *clusterIdsSet = [NSMutableSet new]; | |
NSInteger currentNumberOfRootClusters = 0; | |
for (RDNCluster *cluster in cachedClustersArray) { | |
XCTAssertFalse([clusterIdsSet containsObject:cluster.clusterId], @"Cluster %@ duplicated", cluster.clusterId); | |
[clusterIdsSet addObject:cluster.clusterId]; | |
if (cluster.childClusters.count > 0) { | |
currentNumberOfRootClusters++; | |
} | |
} | |
XCTAssertEqual(expectedCountOfRootClusters, currentNumberOfRootClusters, @"Wrong number of parent clusters"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment