Test: finally put the init of the CPApplication in the instance method setUp. See previous commit #6fe9dae3d62af995f2481bfebdd706aeb0b21365

This commit is contained in:
Alexandre Wilhelm
2015-07-07 15:04:29 -07:00
parent 6fe9dae3d6
commit 923d32ee6d
45 changed files with 47 additions and 143 deletions
+1 -1
View File
@@ -16,7 +16,7 @@
{
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
+1 -7
View File
@@ -61,17 +61,11 @@ var globalResults = [];
CPWindow aWindow;
}
+ (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}
- (void)setUp
{
// This sets up the CPApp convenience variable, the unit tests fails
// if this is not done, because the framework internally uses CPApp.
app = [CPApplication sharedApplication];
app = [[CPApplication alloc] init];
// fake the window.location.hash
window.location = {hash: "#var1=1/var2=2"};
+1 -1
View File
@@ -10,7 +10,7 @@ var ELEMENTS = 200,
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
+3 -6
View File
@@ -18,12 +18,6 @@
CPArray depValues @accessors;
}
+ (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}
- (CPArray)makeTestArray
{
return [[Employee employeeWithName:@"Francisco" department:[Department departmentWithName:@"Cappuccino"]],
@@ -62,6 +56,9 @@
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
_contentArray = [self makeTestArray];
[self initControllerWithSimpleArray]
}
+1 -4
View File
@@ -7,14 +7,11 @@
CPInteger RESIZES_COUNT;
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}
- (void)setUp
{
NUMBER_OF_VIEWS = 50;
RESIZES_COUNT = 250;
}
+1 -4
View File
@@ -8,14 +8,11 @@
CPBrowserDelegate delegate;
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}
- (void)setUp
{
browser = [[CPBrowser alloc] initWithFrame:CGRectMake(0, 0, 500, 300)];
delegate = [CPBrowserDelegate new];
[delegate setEntries:[".1", ".1.1", ".1.2", ".1.2.1", ".1.2.2", ".2", ".3", ".3.1"]];
+1 -4
View File
@@ -8,14 +8,11 @@
BOOL wasClicked;
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}
- (void)setUp
{
button = [CPButton buttonWithTitle:"hello world"];
wasClicked = NO;
}
+1 -1
View File
@@ -4,7 +4,7 @@
{
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
+1 -4
View File
@@ -7,14 +7,11 @@
id _globalResults;
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}
- (void)setUp
{
_collectionView = [[CPCollectionView alloc] initWithFrame:CGRectMakeZero()];
_globalResults = nil;
}
+1 -1
View File
@@ -4,7 +4,7 @@
{
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
+1 -4
View File
@@ -6,14 +6,11 @@
CPColorWell colorWell;
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}
- (void)setUp
{
colorWell = [[CPColorWell alloc] initWithFrame:CGRectMakeZero()];
}
+1 -4
View File
@@ -10,14 +10,11 @@
BOOL wasClicked
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}
- (void)setUp
{
comboBox = [[CPComboBox alloc] initWithFrame:CGRectMake(0, 0, 200, 30)];
}
+1 -4
View File
@@ -8,14 +8,11 @@
BOOL aTransform;
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}
- (void)setUp
{
// set up a dummy DOM element.
DOMElement = {
style: {
+1 -4
View File
@@ -10,14 +10,11 @@
CPDatePicker datePicker;
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}
- (void)setUp
{
datePicker = [[CPDatePicker alloc] initWithFrame:CGRectMake(200, 28, 0, 0)];
}
+1 -1
View File
@@ -5,7 +5,7 @@
{
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
+1 -4
View File
@@ -10,14 +10,11 @@
int tag @accessors;
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}
- (void)setUp
{
fontA = [CPFont systemFontOfSize:8.0];
}
+1 -4
View File
@@ -9,14 +9,11 @@
CPFont _boldCustomFont;
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}
- (void)setUp
{
_systemFont = [CPFont systemFontOfSize:15];
_boldSystemFont = [CPFont boldSystemFontOfSize:15];
+1 -1
View File
@@ -4,7 +4,7 @@
{
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
+1 -1
View File
@@ -8,7 +8,7 @@
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
@@ -18,14 +18,11 @@
CPObjectController objectController @accessors;
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}
- (void)setUp
{
track = [Track new];
[track setVolume:5.0];
}
+1 -1
View File
@@ -21,7 +21,7 @@
CPArrayController arrayController @accessors;
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
+1 -1
View File
@@ -7,7 +7,7 @@
{
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
+1 -4
View File
@@ -17,14 +17,11 @@
CPMenuItem anInstantiatedMenuItem;
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}
- (void)setUp
{
// Set up a fairly complete menu to have something to work with.
menu = [[CPMenu alloc] initWithTitle:@"MainMenu"];
@@ -9,14 +9,11 @@ var CPMenuValidatedUserInterfaceItemTestValidatedItems = [];
MenuTarget _menuTarget @accessors(property=menuTarget);
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}
- (void)setUp
{
_menuTarget = [[MenuTarget alloc] init];
[[CPApplication sharedApplication] setDelegate:_menuTarget];
+1 -4
View File
@@ -9,14 +9,11 @@
TestOutlineDataSource dataSource;
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}
- (void)setUp
{
outlineView = [[CPOutlineView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
tableColumn = [[CPTableColumn alloc] initWithIdentifier:@"Foo"];
+1 -1
View File
@@ -6,7 +6,7 @@
{
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
+1 -4
View File
@@ -9,14 +9,11 @@
id objects @accessors;
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}
- (void)setUp
{
button = [CPPopUpButton new];
}
+1 -4
View File
@@ -6,14 +6,11 @@
CPPredicateEditor _editor;
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}
- (void)setUp
{
_editor = [[CPPredicateEditor alloc] initWithFrame:CGRectMakeZero()];
}
+1 -4
View File
@@ -10,14 +10,11 @@
CPResponder responder;
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}
- (void)setUp
{
responder = [TestResponder new];
responder.doCommandCalls = [];
}
+1 -1
View File
@@ -7,7 +7,7 @@
{
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
+1 -4
View File
@@ -5,14 +5,11 @@
CPSearchField _searchField;
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}
- (void)setUp
{
_searchField = [[CPSearchField alloc] initWithFrame:CGRectMakeZero()];
}
+1 -4
View File
@@ -6,14 +6,11 @@
CPSegmentedControl _segmentedControl;
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}
- (void)setUp
{
_segmentedControl = [[CPSegmentedControl alloc] initWithFrame:CGRectMakeZero()];
[_segmentedControl setSegmentCount:3];
}
+1 -1
View File
@@ -4,7 +4,7 @@
{
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
+1 -4
View File
@@ -8,14 +8,11 @@
CPView viewB;
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}
- (void)setUp
{
splitView = [[CPSplitView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
viewA = [[CPView alloc] initWithFrame:CGRectMake(0, 0, 100, 50)];
viewB = [[CPView alloc] initWithFrame:CGRectMake(0, 0, 100, 50)];
+1 -4
View File
@@ -6,14 +6,11 @@
CPStepper stepper;
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}
- (void)setUp
{
stepper = [CPStepper stepper];
[stepper setValueWraps:NO];
}
+1 -4
View File
@@ -23,14 +23,11 @@
CPTabViewItem _tabItem2;
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}
- (void)setUp
{
_tabView = [[CPTabView alloc] initWithFrame:CGRectMake(0, 0, 800, 600)];
_tabItem1 = [[CPTabViewItem alloc] initWithIdentifier:@"id1"];
+1 -4
View File
@@ -7,14 +7,11 @@
CPArray tableContent;
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}
- (void)setUp
{
tableContent = [];
// setup a reasonable table
theWindow = [[CPWindow alloc] initWithContentRect:CGRectMake(0.0, 0.0, 1024.0, 768.0)
+1 -4
View File
@@ -6,14 +6,11 @@
CPTableView tableView;
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}
- (void)setUp
{
// setup a reasonable table
theWindow = [[CPWindow alloc] initWithContentRect:CGRectMake(0.0, 0.0, 1024.0, 768.0)
styleMask:CPWindowNotSizable];
+1 -4
View File
@@ -13,14 +13,11 @@
int selectionDidChangeNotificationsReceived;
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}
- (void)setUp
{
// setup a reasonable table
theWindow = [[CPWindow alloc] initWithContentRect:CGRectMake(0.0, 0.0, 1024.0, 768.0) styleMask:CPWindowNotSizable];
+1 -1
View File
@@ -5,7 +5,7 @@
{
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
+1 -1
View File
@@ -4,7 +4,7 @@
{
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
+1 -4
View File
@@ -10,14 +10,11 @@
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}
- (void)setUp
{
_theWindow = [[CPWindow alloc] initWithContentRect:CGRectMake(0.0, 0.0, 1024.0, 768.0)
styleMask:CPWindowNotSizable];
+1 -4
View File
@@ -6,14 +6,11 @@
CPTreeNode childNode;
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}
- (void)setUp
{
treeNode = [CPTreeNode treeNodeWithRepresentedObject:nil];
childNode = [CPTreeNode treeNodeWithRepresentedObject:nil];
+1 -4
View File
@@ -13,14 +13,11 @@ var methodCalled;
CPWindow window;
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}
- (void)setUp
{
window = [[CPWindow alloc] initWithContentRect:CGRectMake(0.0, 0.0, 1000.0, 1000.0) styleMask:CPWindowNotSizable];
view = [[CPView alloc] initWithFrame:CGRectMakeZero()];
+1 -4
View File
@@ -7,14 +7,11 @@
CPWindow _window @accessors(property=window);
}
+ (void)setUp
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
}
- (void)setUp
{
_window = [[CPWindow alloc] initWithContentRect:CGRectMake(0.0, 0.0, 1024.0, 768.0)
styleMask:CPWindowNotSizable];
}