iOS Automated Testing



OCUnit Assertions



Example

#import <SenTestingKit/SenTestingKit.h>

@interface QuizTests : SenTestCase

@end

@implementation QuizTests

- (void)setUp {
    [super setUp];
    // Put setup code here. This method is called before the invocation of each test method in the class.
}
- (void)tearDown {
    // Put teardown code here. This method is called after the invocation of each test method in the class.
    [super tearDown];
}
- (void)testMultiplyingTwoNegativeIntegersYieldsPositiveProduct {
  int x = -5;
  int y = -7;
  int product = x * y;
  STAssertTrue((product > 0), @"The product was less than zero.");
}

@end
        


Lab: Write Unit Tests for the Quiz programm in Lecture 13

Before Xcode 5



slide 1/17
* help? contents?