Skip to content

Commit

Permalink
Added a couple of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Egor Tolstoy committed Nov 4, 2015
1 parent 63467e9 commit 7c678b5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Tests/Factory/Internal/TyphoonBlockComponentFactoryTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,15 @@ - (void)test_type_converter_recognized
XCTAssertNotNil(nullConverter);
}

- (void)test_factories_have_different_converter_registries
{
id existingConverter = [_infrastructureComponentsFactory.typeConverterRegistry converterForType:@"NSNull"];
id nonExistingConverter = [_componentFactory.typeConverterRegistry converterForType:@"NSNull"];

XCTAssertNotNil(existingConverter);
XCTAssertNil(nonExistingConverter);
}

//-------------------------------------------------------------------------------------------
#pragma mark - Circular dependencies.

Expand Down
8 changes: 8 additions & 0 deletions Tests/TypeConversion/TyphoonTypeConverterRegistryTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,15 @@ - (void)test_raises_exception_when_converter_registered_more_than_once
@catch (NSException *e) {
XCTAssertEqualObjects([e description], @"Converter for 'NSURL' already registered.");
}
}

- (void)test_unregisters_converter
{
id <TyphoonTypeConverter> converter = [self.registry converterForType:@"NSURL"];
[self.registry unregisterTypeConverter:converter];

converter = [self.registry converterForType:@"NSURL"];
XCTAssertNil(converter);
}

@end

0 comments on commit 7c678b5

Please sign in to comment.