Skip to content

Commit

Permalink
Create test files for unit test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
dmiedema committed Dec 29, 2014
1 parent 2a07b07 commit 2c4f167
Show file tree
Hide file tree
Showing 4 changed files with 146 additions and 5 deletions.
8 changes: 8 additions & 0 deletions CRToastDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
5419E0251A44AE21004C073B /* CRToastWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 5419E0241A44AE21004C073B /* CRToastWindow.m */; };
5419E0281A44AE33004C073B /* CRToastViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5419E0271A44AE33004C073B /* CRToastViewController.m */; };
5419E02B1A44AE5A004C073B /* CRToastManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 5419E02A1A44AE5A004C073B /* CRToastManager.m */; };
547BC2421A4FCA42004C45FE /* CRToastViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 547BC2411A4FCA42004C45FE /* CRToastViewTests.m */; };
547BC2441A4FCA54004C45FE /* CRToastManagerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 547BC2431A4FCA54004C45FE /* CRToastManagerTests.m */; };
5E0D045E1838AE0D00CBFC35 /* CRToast.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E0D045D1838AE0D00CBFC35 /* CRToast.m */; };
5E2FFB5718367C01003333F8 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E2FFB5618367C01003333F8 /* Foundation.framework */; };
5E2FFB5918367C01003333F8 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E2FFB5818367C01003333F8 /* CoreGraphics.framework */; };
Expand Down Expand Up @@ -71,6 +73,8 @@
5419E0271A44AE33004C073B /* CRToastViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CRToastViewController.m; sourceTree = "<group>"; };
5419E0291A44AE5A004C073B /* CRToastManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CRToastManager.h; sourceTree = "<group>"; };
5419E02A1A44AE5A004C073B /* CRToastManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CRToastManager.m; sourceTree = "<group>"; };
547BC2411A4FCA42004C45FE /* CRToastViewTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CRToastViewTests.m; sourceTree = "<group>"; };
547BC2431A4FCA54004C45FE /* CRToastManagerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CRToastManagerTests.m; sourceTree = "<group>"; };
54893C321A44D803005653C6 /* CRToastLayoutHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CRToastLayoutHelpers.h; sourceTree = "<group>"; };
56E21D16D0A5B551EC7F898B /* Pods-Acceptance Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Acceptance Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Acceptance Tests/Pods-Acceptance Tests.debug.xcconfig"; sourceTree = "<group>"; };
5E0D045C1838AE0D00CBFC35 /* CRToast.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CRToast.h; path = CRToast/CRToast.h; sourceTree = SOURCE_ROOT; };
Expand Down Expand Up @@ -163,6 +167,8 @@
children = (
2D8F2E1218CED50A0077A7F6 /* CRToastTests.m */,
2D8F2E0D18CED50A0077A7F6 /* Supporting Files */,
547BC2411A4FCA42004C45FE /* CRToastViewTests.m */,
547BC2431A4FCA54004C45FE /* CRToastManagerTests.m */,
);
path = "Unit Tests";
sourceTree = "<group>";
Expand Down Expand Up @@ -452,6 +458,8 @@
buildActionMask = 2147483647;
files = (
2D8F2E1318CED50A0077A7F6 /* CRToastTests.m in Sources */,
547BC2441A4FCA54004C45FE /* CRToastManagerTests.m in Sources */,
547BC2421A4FCA42004C45FE /* CRToastViewTests.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
43 changes: 43 additions & 0 deletions Tests/Unit Tests/CRToastManagerTests.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//
// CRToastManagerTests.m
// CRToastDemo
//
// Created by Daniel on 12/27/14.
// Copyright (c) 2014 Collin Ruffenach. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>
#import "CRToastManager.h"
#import "CRToast.h"

@interface CRToastManagerTests : XCTestCase
@end

@implementation CRToastManagerTests

- (void)testEmptyDefaultOptions
{
[CRToastManager setDefaultOptions:@{}];
}


- (void)testPerformanceExample {
// This is an example of a performance test case.
[self measureBlock:^{
// Put the code you want to measure the time of here.
}];
}

#pragma mark - Setup
- (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];
}

@end
5 changes: 0 additions & 5 deletions Tests/Unit Tests/CRToastTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,4 @@ - (void)tearDown
[super tearDown];
}

- (void)testEmptyDefaultOptions
{
[CRToastManager setDefaultOptions:@{}];
}

@end
95 changes: 95 additions & 0 deletions Tests/Unit Tests/CRToastViewTests.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
//
// CRToastViewTests.m
// CRToastDemo
//
// Created by Daniel on 12/27/14.
// Copyright (c) 2014 Collin Ruffenach. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>
#import "CRToastView.h"
#import "CRToast.h"

@interface CRToastViewTests : XCTestCase

@end

@implementation CRToastViewTests

- (void)testExample {
// This is an example of a functional test case.
XCTAssert(YES, @"Pass");
}

#pragma mark Image Alignment
- (void)testImageFrameLeftAlignment {

}

- (void)testImageFrameCenterAlignment {

}

- (void)testImageFrameRightAlignment {

}

#pragma mark Activity Indicator Alignment
- (void)testActivityFrameLeftAlignment {

}

- (void)testActivityFrameCenterAlignment {

}

- (void)testActivityFrameRightAlignment {

}

#pragma mark Width Calculations
- (void)testWidthWithOnlyLeftItem {

}

- (void)testWidthWithOnlyCenterItem {

}

- (void)testWidthWithOnlyRightItem {

}

- (void)testWidthWithLeftAndCenter {

}

- (void)testWidthWithLeftAndRight {

}


- (void)testPerformanceExample {
// This is an example of a performance test case.
[self measureBlock:^{
// Put the code you want to measure the time of here.
}];
}

#pragma mark - Setup
- (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];
}

- (CRToast *)testToast {
return [[CRToast alloc] init];
}

@end

0 comments on commit 2c4f167

Please sign in to comment.