-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from johankool/master
Added test for service container, remove no longer functioning tests
- Loading branch information
Showing
12 changed files
with
222 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +0,0 @@ | ||
[submodule "External/Kiwi"] | ||
path = External/Kiwi | ||
url = git://github.com/allending/Kiwi.git | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// | ||
// Prefix header | ||
// | ||
// The contents of this file are implicitly included at the beginning of every source file. | ||
// | ||
|
||
#ifdef __OBJC__ | ||
#import <UIKit/UIKit.h> | ||
#import <Foundation/Foundation.h> | ||
#endif |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Pod::Spec.new do |s| | ||
s.name = "Egeniq" | ||
s.version = "0.1.0" | ||
s.version = "0.1.1" | ||
s.summary = "Egeniq Library for iOS projects" | ||
|
||
s.description = <<-DESC | ||
|
@@ -39,7 +39,7 @@ Pod::Spec.new do |s| | |
"Johan Kool" => "[email protected]", | ||
"Felix De Vliegher" => "[email protected]"} | ||
|
||
s.platform = :ios, '5.0' | ||
s.platform = :ios, '5.1.1' | ||
|
||
s.source = { :git => "https://github.com/egeniq/egeniq-ios.git", :tag => s.version.to_s } | ||
|
||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// | ||
// EFServiceContainerTest.m | ||
// Egeniq | ||
// | ||
// Created by Johan Kool on 13/2/2014. | ||
// Copyright (c) 2014 Egeniq. All rights reserved. | ||
// | ||
|
||
#import <XCTest/XCTest.h> | ||
|
||
#import "EFServiceContainer.h" | ||
#import "EFServiceContainer-Protected.h" | ||
|
||
@interface MYTestContainer : EFServiceContainer | ||
|
||
@property (nonatomic, strong) NSObject *testService; | ||
|
||
@end | ||
|
||
@implementation MYTestContainer | ||
|
||
- (NSObject *)testService { | ||
return [self serviceForKey:1 initializer:^id{ | ||
return [[[NSObject alloc] init] autorelease]; | ||
}]; | ||
} | ||
|
||
@end | ||
|
||
@interface EFServiceContainerTest : XCTestCase | ||
|
||
@end | ||
|
||
@implementation EFServiceContainerTest | ||
|
||
- (void)setUp { | ||
[super setUp]; | ||
// Put setup code here; it will be run once, before the first test case. | ||
} | ||
|
||
- (void)tearDown { | ||
// Put teardown code here; it will be run once, after the last test case. | ||
[super tearDown]; | ||
} | ||
|
||
- (void)testClass { | ||
MYTestContainer *test = [MYTestContainer sharedInstance]; | ||
XCTAssertTrue([test isKindOfClass:[MYTestContainer class]], @"Ensure correct class is instantiated"); | ||
} | ||
|
||
- (void)testSameService { | ||
MYTestContainer *test = [MYTestContainer sharedInstance]; | ||
NSObject *service1 = test.testService; | ||
|
||
MYTestContainer *test2 = [MYTestContainer sharedInstance]; | ||
NSObject *service2 = test2.testService; | ||
|
||
XCTAssertEqualObjects(service1, service2, @"Expected the same service"); | ||
} | ||
|
||
- (void)testSameServiceOnDifferentThreads { | ||
__block NSObject *service1; | ||
dispatch_sync(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{ | ||
MYTestContainer *test = [MYTestContainer sharedInstance]; | ||
service1 = test.testService; | ||
}); | ||
|
||
MYTestContainer *test2 = [MYTestContainer sharedInstance]; | ||
NSObject *service2 = test2.testService; | ||
|
||
XCTAssertEqualObjects(service1, service2, @"Expected the same service"); | ||
} | ||
|
||
@end |
This file was deleted.
Oops, something went wrong.
Submodule Kiwi
deleted from
67d5de