Skip to content
This repository has been archived by the owner on Apr 25, 2019. It is now read-only.

Fix #101 restore tests #102

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 1 addition & 38 deletions FPPicker Tests/Functional Tests/FPConfigTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,31 +52,11 @@ - (void)testNewReturnsTheSharedInstance
@"new should return a shared instance");
}

- (void)testAPIKeyFromPList
{
id configMock = OCMPartialMock([FPConfig sharedInstance]);

OCMStub([configMock APIKeyContentsFromFile]); // return nil

id mainBundleMock = OCMPartialMock([NSBundle mainBundle]);

NSDictionary *infoDictionary = [NSDictionary mergeDictionary:[[NSBundle mainBundle] infoDictionary]
into:@{@"Filepicker API Key":@"MY_OTHER_API_KEY"}];

OCMStub([mainBundleMock infoDictionary]).andReturn(infoDictionary);

XCTAssertEqualObjects([FPConfig sharedInstance].APIKey,
@"MY_OTHER_API_KEY",
@"API key does not match");

OCMVerifyAll(configMock);
}

- (void)testAPIKeyUsingMacro
{
id configMock = OCMPartialMock([FPConfig sharedInstance]);

OCMStub([configMock APIKeyContentsFromFile]).andReturn(@"MY_API_KEY");
OCMStub([configMock APIKey]).andReturn(@"MY_API_KEY");

XCTAssertEqualObjects([FPConfig sharedInstance].APIKey,
fpAPIKEY,
Expand All @@ -85,23 +65,6 @@ - (void)testAPIKeyUsingMacro
OCMVerifyAll(configMock);
}

- (void)testAppSecretKeyFromPList
{
id configMock = OCMPartialMock([FPConfig sharedInstance]);
id mainBundleMock = OCMPartialMock([NSBundle mainBundle]);

NSDictionary *infoDictionary = [NSDictionary mergeDictionary:[[NSBundle mainBundle] infoDictionary]
into:@{@"Filepicker App Secret Key":@"MY_SECRET_APP_KEY"}];

OCMStub([mainBundleMock infoDictionary]).andReturn(infoDictionary);

XCTAssertEqualObjects([FPConfig sharedInstance].appSecretKey,
@"MY_SECRET_APP_KEY",
@"App secret key does not match");

OCMVerifyAll(configMock);
}

- (void)testAppSecretKeyUsingMacro
{
id configMock = OCMPartialMock([FPConfig sharedInstance]);
Expand Down
Loading