mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2025-12-12 04:12:13 +00:00
Cleaned up (removed comments etc.)
This commit is contained in:
parent
1216c9abed
commit
3903df6e64
@ -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;
|
||||
|
||||
@ -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]; }
|
||||
|
||||
@ -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
|
||||
@ -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;
|
||||
|
||||
@ -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
|
||||
@ -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;
|
||||
|
||||
@ -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
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user