Skip to content

Instantly share code, notes, and snippets.

@retrokid
Last active November 27, 2020 08:24
Show Gist options
  • Save retrokid/cc0b143534f8420c72d0c4b9ba16c3f6 to your computer and use it in GitHub Desktop.
Save retrokid/cc0b143534f8420c72d0c4b9ba16c3f6 to your computer and use it in GitHub Desktop.

Xcode Unit Test

NSLog(@"%s doing work...", __PRETTY_FUNCTION__);

XCTAssertEqual(matchCount, expectedCount,@"Should have matched");

XCTAssertNotEqual(matchCount, differentCount,@"Should not be matched");

XCTAssertEqualObjects(drawnCard1, drawnCard2, @"The objects must be same");

XCTAssertNotEqualObjects(drawnCard1, drawnCard2, @"The objects must be different");

XCTAssertTrue([card isKindOfClass:[PlayingCard class]], @"Must be true");

XCTAssertFalse([card isKindOfClass:[PlayingCard class]], @"Must be false");

XCTAssertNotNil(drawnCard2, @"Must not be empty");

XCTAssertNil(drawnCard, @"Must be empty");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment