Cleaned up (removed comments etc.)

This commit is contained in:
Stefan van den Oord 2013-05-31 21:26:06 +02:00
parent 1216c9abed
commit 3903df6e64
10 changed files with 7 additions and 97 deletions

View File

@ -1,14 +1,5 @@
//
// Created by Stefan on 5/31/13.
// Copyright (c) 2013 Stefan van den Oord. All rights reserved.
//
// To change the template use AppCode | Preferences | File Templates.
//
#import <Foundation/Foundation.h>
@interface TennisGame : NSObject
- (id)initWithPlayer1:(NSString *)player1 player2:(NSString *)player2;

View File

@ -1,15 +1,6 @@
//
// Created by Stefan on 5/31/13.
// Copyright (c) 2013 Stefan van den Oord. All rights reserved.
//
// To change the template use AppCode | Preferences | File Templates.
//
#import "TennisGame3.h"
#import "TennisGame.h"
@implementation TennisGame
- (id)initWithPlayer1:(NSString *)player1 player2:(NSString *)player2 { return [super init]; }

View File

@ -1,16 +1,5 @@
//
// Created by Stefan on 5/31/13.
// Copyright (c) 2013 Stefan van den Oord. All rights reserved.
//
// To change the template use AppCode | Preferences | File Templates.
//
#import <Foundation/Foundation.h>
#import "TennisGame.h"
@interface TennisGame1 : TennisGame
@property(nonatomic, copy) NSString *player1;
@property(nonatomic, copy) NSString *player2;
@end

View File

@ -1,13 +1,9 @@
//
// Created by Stefan on 5/31/13.
// Copyright (c) 2013 Stefan van den Oord. All rights reserved.
//
// To change the template use AppCode | Preferences | File Templates.
//
#import "TennisGame1.h"
@interface TennisGame1 ()
@property(nonatomic, copy) NSString *player1;
@property(nonatomic, copy) NSString *player2;
@end
@implementation TennisGame1 {
int score1;

View File

@ -1,14 +1,5 @@
//
// Created by Stefan on 5/31/13.
// Copyright (c) 2013 Stefan van den Oord. All rights reserved.
//
// To change the template use AppCode | Preferences | File Templates.
//
#import <Foundation/Foundation.h>
#import "TennisGame.h"
@interface TennisGame2 : TennisGame
@end

View File

@ -1,14 +1,5 @@
//
// Created by Stefan on 5/31/13.
// Copyright (c) 2013 Stefan van den Oord. All rights reserved.
//
// To change the template use AppCode | Preferences | File Templates.
//
#import "TennisGame2.h"
@interface TennisGame2 ()
@property(nonatomic, copy) NSString *player2Name;
@property(nonatomic, copy) NSString *player1Name;

View File

@ -1,14 +1,5 @@
//
// Created by Stefan on 5/31/13.
// Copyright (c) 2013 Stefan van den Oord. All rights reserved.
//
// To change the template use AppCode | Preferences | File Templates.
//
#import <Foundation/Foundation.h>
#import "TennisGame.h"
@interface TennisGame3 : TennisGame
@end

View File

@ -1,14 +1,5 @@
//
// Created by Stefan on 5/31/13.
// Copyright (c) 2013 Stefan van den Oord. All rights reserved.
//
// To change the template use AppCode | Preferences | File Templates.
//
#import "TennisGame3.h"
@interface TennisGame3 ()
@end

View File

@ -1,14 +1,5 @@
//
// TennisTests.h
// TennisTests
//
// Created by Stefan on 05/31/13.
// Copyright (c) 2013 Stefan van den Oord. All rights reserved.
//
#import <SenTestingKit/SenTestingKit.h>
@interface TennisTests : SenTestCase
- (id)initWithInvocation:(NSInvocation *)invocation scores:(NSArray *)scores;
@end

View File

@ -1,11 +1,3 @@
//
// TennisTests.m
// TennisTests
//
// Created by Stefan on 05/31/13.
// Copyright (c) 2013 Stefan van den Oord. All rights reserved.
//
#import <SenTestingKit/SenTestingKit.h>
#import "TennisTests.h"
#import "TennisGame1.h"
@ -30,12 +22,7 @@
+ (void)addTestWithScores:(NSArray *)scores toTestSuite:(SenTestSuite *)testSuite {
NSArray *testInvocations = [self testInvocations];
for (NSInvocation *testInvocation in testInvocations) {
// Create a new instance of our test case for each method found using the given set of parameters.
SenTestCase *test = [[TennisTests alloc] initWithInvocation:testInvocation
scores:scores];
// Add the new test instance to the suite. The OCUnit framework eventually executes the entire test suite.
SenTestCase *test = [[TennisTests alloc] initWithInvocation:testInvocation scores:scores];
[testSuite addTest:test];
}
}
@ -101,7 +88,8 @@
}
- (NSString *)name {
return [[super name] stringByReplacingOccurrencesOfString:@"]" withString:[NSString stringWithFormat:@" (%d,%d,%@)]", player1Score, player2Score, expectedScore]];
NSString *parametersDescription = [NSString stringWithFormat:@" (%d,%d,%@)]", player1Score, player2Score, expectedScore];
return [[super name] stringByReplacingOccurrencesOfString:@"]" withString:parametersDescription];
}
- (void)checkAllScoresForGame:(TennisGame *)game {