Skip to content

Commit

Permalink
Add test coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jasper Blues committed Feb 10, 2013
1 parent 5ebf648 commit 50405ca
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Tests/Factory/TyphoonComponentFactoryTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#import "CavalryMan.h"
#import "Champion.h"
#import "AutoWiringKnight.h"
#import "Harlot.h"


static NSString* const DEFAULT_QUEST = @"quest";
Expand Down Expand Up @@ -132,6 +133,16 @@ - (void)test_objectForType
{
assertThat([e description], equalTo(@"No components defined which satisify type: 'Champion'"));
}

@try
{
id<Harlot> harlot = [_componentFactory componentForType:@protocol(Harlot)];
STFail(@"Should have thrown exception");
}
@catch (NSException* e)
{
assertThat([e description], equalTo(@"No components defined which satisify type: 'id<Harlot>'"));
}
}

- (void)test_objectForKey_returns_singleton_with_property_dependencies_resolved_by_type
Expand Down
15 changes: 15 additions & 0 deletions Tests/Harlot.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
////////////////////////////////////////////////////////////////////////////////
//
// MOD PRODUCTIONS
// Copyright 2013 Mod Productions
// All Rights Reserved.
//
// NOTICE: Mod Productions permit you to use, modify, and distribute this file
// in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////

#import <Foundation/Foundation.h>

@protocol Harlot <NSObject>
@end
4 changes: 4 additions & 0 deletions Typhoon.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
BA798B0E98DACFF7F724848B /* CircularDependenciesAssembly.m in Sources */ = {isa = PBXBuildFile; fileRef = BA798718B12F783930A46333 /* CircularDependenciesAssembly.m */; };
BA798B291EDCA2E25701D626 /* TyphoonDefinition.h in Headers */ = {isa = PBXBuildFile; fileRef = BA798CA3A88193EC0242E6EC /* TyphoonDefinition.h */; };
BA798B82BE8C9399E0DAC53C /* TyphoonParameterInjectedByValue.m in Sources */ = {isa = PBXBuildFile; fileRef = BA7987099DAD3FC6A242E863 /* TyphoonParameterInjectedByValue.m */; };
BA798B8C40CBB04CFA2AC82E /* Harlot.h in Install Hamcrest and Mockito */ = {isa = PBXBuildFile; fileRef = BA798B9A1B9A8AA11D46EF95 /* Harlot.h */; };
BA798BB4D9038A4C5E6B8FFF /* TyphoonTypeConverter.h in Headers */ = {isa = PBXBuildFile; fileRef = BA7983E3C21E67A0ABCEB3C4 /* TyphoonTypeConverter.h */; };
BA798BBAFE0BD0E6B8595BC7 /* Info-iOS.plist in Resources */ = {isa = PBXBuildFile; fileRef = BA798F0C33EBF7B9102B886A /* Info-iOS.plist */; };
BA798BE56FC8C7D40AEC1ECB /* TyphoonPrimitiveTypeConverterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = BA79835B6157EAC72445EC18 /* TyphoonPrimitiveTypeConverterTests.m */; };
Expand Down Expand Up @@ -158,6 +159,7 @@
files = (
6B7CE44516C74919002E0107 /* OCMockito.framework in Install Hamcrest and Mockito */,
6BD2B6E216AC031B0066C5DB /* OCHamcrest.framework in Install Hamcrest and Mockito */,
BA798B8C40CBB04CFA2AC82E /* Harlot.h in Install Hamcrest and Mockito */,
);
name = "Install Hamcrest and Mockito";
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -259,6 +261,7 @@
BA798AC8A5E199CCE249DBB6 /* TyphoonNSURLTypeConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TyphoonNSURLTypeConverter.m; sourceTree = "<group>"; };
BA798AF66DE1ED5E61866145 /* Champion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Champion.h; sourceTree = "<group>"; };
BA798B3CB0EE595B87ED5B1C /* TyphoonPropertyInjectedByValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TyphoonPropertyInjectedByValue.h; sourceTree = "<group>"; };
BA798B9A1B9A8AA11D46EF95 /* Harlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Harlot.h; sourceTree = "<group>"; };
BA798BC151C9C2FC6B82D48B /* TyphoonDefinition+BlockAssembly.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "TyphoonDefinition+BlockAssembly.m"; sourceTree = "<group>"; };
BA798BD1C3AC7C8500D9191E /* Knight.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Knight.m; sourceTree = "<group>"; };
BA798BDAEB237C52367719BA /* TyphoonJRSwizzle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TyphoonJRSwizzle.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -373,6 +376,7 @@
BA7985A14209EDAA0D5F322C /* Resources */,
BA7983C55C137AC3C4B21455 /* TypeConversion */,
BA798CC05964B6ED55F0AE50 /* Utils */,
BA798B9A1B9A8AA11D46EF95 /* Harlot.h */,
);
path = Tests;
sourceTree = "<group>";
Expand Down

0 comments on commit 50405ca

Please sign in to comment.