Fix Unit Tests

- Adopt new fields from SecretsProvider in FeedlyTestSecrets
-Fix call to Account init that was expecting an optional
- Linked `Articles` and `RSCore` libraries to the Unit Tests target
- Small change to order of imports for consistency
This commit is contained in:
Fábio Oliveira 2021-02-24 01:13:47 +01:00
parent 670996fdc2
commit d05594dafb
4 changed files with 39 additions and 4 deletions

View File

@ -17,4 +17,6 @@ struct FeedlyTestSecrets: SecretsProvider {
var twitterConsumerKey = "" var twitterConsumerKey = ""
var twitterConsumerSecret = "" var twitterConsumerSecret = ""
var redditConsumerKey = "" var redditConsumerKey = ""
var inoreaderAppId = ""
var inoreaderAppKey = ""
} }

View File

@ -32,7 +32,7 @@ class TestAccountManager {
abort() abort()
} }
let account = Account(dataFolder: accountFolder.absoluteString, type: type, accountID: accountID, transport: transport)! let account = Account(dataFolder: accountFolder.absoluteString, type: type, accountID: accountID, transport: transport)
return account return account

View File

@ -146,6 +146,10 @@
3B826DCC2385C84800FC1ADB /* AccountsFeedWranglerWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B826DCA2385C84800FC1ADB /* AccountsFeedWranglerWindowController.swift */; }; 3B826DCC2385C84800FC1ADB /* AccountsFeedWranglerWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B826DCA2385C84800FC1ADB /* AccountsFeedWranglerWindowController.swift */; };
3B826DCD2385C89600FC1ADB /* AccountsFeedWrangler.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3B826DB02385C84800FC1ADB /* AccountsFeedWrangler.xib */; }; 3B826DCD2385C89600FC1ADB /* AccountsFeedWrangler.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3B826DB02385C84800FC1ADB /* AccountsFeedWrangler.xib */; };
3B826DCE2385C89600FC1ADB /* AccountsFeedWranglerWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B826DCA2385C84800FC1ADB /* AccountsFeedWranglerWindowController.swift */; }; 3B826DCE2385C89600FC1ADB /* AccountsFeedWranglerWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B826DCA2385C84800FC1ADB /* AccountsFeedWranglerWindowController.swift */; };
4679674625E599C100844E8D /* Articles in Frameworks */ = {isa = PBXBuildFile; productRef = 4679674525E599C100844E8D /* Articles */; };
4679674725E599C100844E8D /* Articles in Embed Frameworks */ = {isa = PBXBuildFile; productRef = 4679674525E599C100844E8D /* Articles */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
4679674925E599C100844E8D /* RSCore in Frameworks */ = {isa = PBXBuildFile; productRef = 4679674825E599C100844E8D /* RSCore */; };
4679674A25E599C100844E8D /* RSCore in Embed Frameworks */ = {isa = PBXBuildFile; productRef = 4679674825E599C100844E8D /* RSCore */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
49F40DF82335B71000552BF4 /* newsfoot.js in Resources */ = {isa = PBXBuildFile; fileRef = 49F40DEF2335B71000552BF4 /* newsfoot.js */; }; 49F40DF82335B71000552BF4 /* newsfoot.js in Resources */ = {isa = PBXBuildFile; fileRef = 49F40DEF2335B71000552BF4 /* newsfoot.js */; };
49F40DF92335B71000552BF4 /* newsfoot.js in Resources */ = {isa = PBXBuildFile; fileRef = 49F40DEF2335B71000552BF4 /* newsfoot.js */; }; 49F40DF92335B71000552BF4 /* newsfoot.js in Resources */ = {isa = PBXBuildFile; fileRef = 49F40DEF2335B71000552BF4 /* newsfoot.js */; };
510289CD24519A1D00426DDF /* SelectComboTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 510289CC24519A1D00426DDF /* SelectComboTableViewCell.swift */; }; 510289CD24519A1D00426DDF /* SelectComboTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 510289CC24519A1D00426DDF /* SelectComboTableViewCell.swift */; };
@ -1245,6 +1249,18 @@
name = "Embed Frameworks"; name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
4679672A25E596BA00844E8D /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
4679674A25E599C100844E8D /* RSCore in Embed Frameworks */,
4679674725E599C100844E8D /* Articles in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
5102AE7324D17FAA0050839C /* Embed Frameworks */ = { 5102AE7324D17FAA0050839C /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase; isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
@ -2208,6 +2224,8 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
4679674925E599C100844E8D /* RSCore in Frameworks */,
4679674625E599C100844E8D /* Articles in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@ -4029,6 +4047,7 @@
849C646E1ED37A5D003D8FC0 /* Frameworks */, 849C646E1ED37A5D003D8FC0 /* Frameworks */,
849C646F1ED37A5D003D8FC0 /* Resources */, 849C646F1ED37A5D003D8FC0 /* Resources */,
D5907C9B20022EC7005947E5 /* CopyFiles */, D5907C9B20022EC7005947E5 /* CopyFiles */,
4679672A25E596BA00844E8D /* Embed Frameworks */,
); );
buildRules = ( buildRules = (
); );
@ -4036,6 +4055,10 @@
849C64731ED37A5D003D8FC0 /* PBXTargetDependency */, 849C64731ED37A5D003D8FC0 /* PBXTargetDependency */,
); );
name = NetNewsWireTests; name = NetNewsWireTests;
packageProductDependencies = (
4679674525E599C100844E8D /* Articles */,
4679674825E599C100844E8D /* RSCore */,
);
productName = NetNewsWireTests; productName = NetNewsWireTests;
productReference = 849C64711ED37A5D003D8FC0 /* NetNewsWireTests.xctest */; productReference = 849C64711ED37A5D003D8FC0 /* NetNewsWireTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test"; productType = "com.apple.product-type.bundle.unit-test";
@ -4046,7 +4069,7 @@
849C64581ED37A5D003D8FC0 /* Project object */ = { 849C64581ED37A5D003D8FC0 /* Project object */ = {
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastSwiftUpdateCheck = 1220; LastSwiftUpdateCheck = 1240;
LastUpgradeCheck = 0930; LastUpgradeCheck = 0930;
ORGANIZATIONNAME = "Ranchero Software"; ORGANIZATIONNAME = "Ranchero Software";
TargetAttributes = { TargetAttributes = {
@ -6236,6 +6259,15 @@
package = 51383A3024D1F90E0027E272 /* XCRemoteSwiftPackageReference "RSWeb" */; package = 51383A3024D1F90E0027E272 /* XCRemoteSwiftPackageReference "RSWeb" */;
productName = RSWeb; productName = RSWeb;
}; };
4679674525E599C100844E8D /* Articles */ = {
isa = XCSwiftPackageProductDependency;
productName = Articles;
};
4679674825E599C100844E8D /* RSCore */ = {
isa = XCSwiftPackageProductDependency;
package = 5102AE4324D17E820050839C /* XCRemoteSwiftPackageReference "RSCore" */;
productName = RSCore;
};
5102AE6824D17F7C0050839C /* RSCore */ = { 5102AE6824D17F7C0050839C /* RSCore */ = {
isa = XCSwiftPackageProductDependency; isa = XCSwiftPackageProductDependency;
package = 5102AE4324D17E820050839C /* XCRemoteSwiftPackageReference "RSCore" */; package = 5102AE4324D17E820050839C /* XCRemoteSwiftPackageReference "RSCore" */;

View File

@ -6,9 +6,10 @@
// Copyright © 2019 Ranchero Software. All rights reserved. // Copyright © 2019 Ranchero Software. All rights reserved.
// //
import XCTest
@testable import NetNewsWire
import Articles import Articles
import XCTest
@testable import NetNewsWire
class SharingTests: XCTestCase { class SharingTests: XCTestCase {