Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.
Open
9 changes: 4 additions & 5 deletions Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Tests/CrashControllerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class CrashControllerTests: XCTestCase {

var newCrash: CrashController {
let resource = Resource(from: [:])
let network = Network()
let network = HTTPNetwork()
let scheduler = Scheduler(with: network)

let crash = CrashController(with: scheduler, resource: resource)
Expand Down
2 changes: 1 addition & 1 deletion Tests/Library/JSON/EncodableTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct FailMock: Encodable {
let surname: String

func encode(to encoder: Encoder) throws {
throw Network.Error.invalidData
throw HTTPNetwork.Error.invalidData
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ enum MockRouter: Routable {
case badURL
case ok

var method: Network.Method { return .get }
var method: HTTPNetwork.Method { return .get }

var path: String {
let status = "status/"
Expand All @@ -48,7 +48,7 @@ enum MockRouter: Routable {

return request
case .badURL:
throw Network.Error.invalidURL
throw HTTPNetwork.Error.invalidURL
}
}
}
Expand All @@ -68,14 +68,14 @@ final class NetworkTests: XCTestCase {
// MARK: - Tests

func testConfiguration() {
let configuration = Network.Configuration.default
let configuration = HTTPNetwork.Configuration.default

XCTAssertEqual(configuration.timeoutIntervalForRequest, 15.0)
XCTAssertEqual(configuration.timeoutIntervalForResource, 15.0)
}

func testReset() {
let network = Network()
let network = HTTPNetwork()
network.reset()

// nothing here, if anything it would crash the whole test suite
Expand All @@ -84,7 +84,7 @@ final class NetworkTests: XCTestCase {
func testMakingRequest_success() {
let async = expectation(description: "network request success")

let network = Network()
let network = HTTPNetwork()
network.authorization = "test"

let task = network.request(MockRouter.ok) {
Expand All @@ -103,7 +103,7 @@ final class NetworkTests: XCTestCase {
var task: URLSessionTask?
let async = expectation(description: "network request clientError")

let network = Network()
let network = HTTPNetwork()
network.authorization = "test"
task = network.request(MockRouter.clientError) {
switch $0 {
Expand All @@ -122,7 +122,7 @@ final class NetworkTests: XCTestCase {
func testMakingRequest_serverError() {
let async = expectation(description: "network request serverError")

let network = Network()
let network = HTTPNetwork()
network.authorization = "test"

var task: URLSessionTask?
Expand All @@ -143,7 +143,7 @@ final class NetworkTests: XCTestCase {
func testMakingRequest_failsWithAuth() {
let async = expectation(description: "network request failsWithAuth")

let network = Network()
let network = HTTPNetwork()
network.authorization = nil

var task: URLSessionTask?
Expand All @@ -164,7 +164,7 @@ final class NetworkTests: XCTestCase {
func testMakingRequest_successWithConfiguration() {
let async = expectation(description: "network request successWithConfiguration")

let network = Network()
let network = HTTPNetwork()
network.configuration.additionalHeaders = [
.authorization: "xxx"
]
Expand All @@ -189,7 +189,7 @@ final class NetworkTests: XCTestCase {
let async = expectation(description: "network request failureWithBadURL")
var error: Error?

let network = Network()
let network = HTTPNetwork()
let task = network.request(MockRouter.badURL) {
switch $0 {
case .success:
Expand All @@ -214,7 +214,7 @@ final class NetworkTests: XCTestCase {

let async = expectation(description: "network request clientError")

let network = Network()
let network = HTTPNetwork()
network.authorization = "test"

task = network.upload(MockRouter.clientError, name: "test", file: Data()) {
Expand All @@ -236,7 +236,7 @@ final class NetworkTests: XCTestCase {

let async = expectation(description: "network request clientError")

let network = Network()
let network = HTTPNetwork()
network.authorization = "test"

task = network.upload(MockRouter.clientError, name: "test", file: Data(), parameters: ["1": "1", "2": "2"]) {
Expand All @@ -256,7 +256,7 @@ final class NetworkTests: XCTestCase {
func testMakingUpload_serverError() {
let async = expectation(description: "network request serverError")

let network = Network()
let network = HTTPNetwork()
network.authorization = "test"

var task: URLSessionTask?
Expand All @@ -277,7 +277,7 @@ final class NetworkTests: XCTestCase {
func testMakingUpload_failsWithAuth() {
let async = expectation(description: "network request failsWithAuth")

let network = Network()
let network = HTTPNetwork()
network.authorization = nil

var task: URLSessionTask?
Expand All @@ -299,7 +299,7 @@ final class NetworkTests: XCTestCase {
let async = expectation(description: "network request failureWithBadURL")
var error: Error?

let network = Network()
let network = HTTPNetwork()
let task = network.upload(MockRouter.badURL, name: "test", file: Data()) {
switch $0 {
case .success:
Expand Down
6 changes: 3 additions & 3 deletions Tests/SchedulerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ final class SchedulerTests: XCTestCase {
// MARK: - Tests

func testMetricRequest() {
let network = Network()
let network = HTTPNetwork()
let scheduler = Scheduler(with: network)
let metric = Metric(descriptor: Metric.Descriptor(name: .appCrashTotal, description: "", unit: .bytes, type: .cumulativeDistribution, keys: []), timeseries: [])
let resource = Resource(from: ["test":"test"])
Expand All @@ -41,7 +41,7 @@ final class SchedulerTests: XCTestCase {
}

func testTraceRequest() {
let network = Network()
let network = HTTPNetwork()
let scheduler = Scheduler(with: network)
let trace = TraceModel(id: "12345678", spans: [], resource: nil, type: .view)
let test2 = expectation(description: "test2")
Expand All @@ -54,7 +54,7 @@ final class SchedulerTests: XCTestCase {
}

func testCrashRequest() {
let network = Network()
let network = HTTPNetwork()
let scheduler = Scheduler(with: network)
let crash = Crash(id: "id", timestamp: "1", title: "title", appVersion: "1", buildVersion: "1", osVersion: "1", deviceType: "ios", sessionId: "s1", network: "network", carrier: "c1", deviceId: "d1", eventIdentifier: "e1", crashedWithoutSession: false, report: Data())
let test3 = expectation(description: "test3")
Expand Down
2 changes: 0 additions & 2 deletions Tests/SwiftOnlyLoadTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ final class SwiftOnlyLoadTests: XCTestCase {
// MARK: - Tests

func testSwiftStart() {
SwiftOnlyLoad.awake()

XCTAssertGreaterThan(Trace.currentSession, 0)
}

Expand Down
2 changes: 1 addition & 1 deletion Tests/TraceConfigurationInteractorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ final class TraceConfigurationInteractorTests: XCTestCase {

/// Use integration test target for .plist checks
func testConfiguration_fails() {
let network = Network()
let network = HTTPNetwork()
let configuration = TraceConfigurationInteractor(network: network)

XCTAssertFalse(configuration.setup())
Expand Down
2 changes: 1 addition & 1 deletion Tests/TracerTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ final class TracerTests: XCTestCase {

let tracer: Tracer = {
let resource = Resource(from: [:])
let network = Network()
let network = HTTPNetwork()
let database = Database()
let session = Session()
let scheduler = Scheduler(with: network)
Expand Down
12 changes: 6 additions & 6 deletions Tests/UIApplicationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,22 @@ final class UIApplicationTests: XCTestCase {
func testCurrentViewController() {
let application = UIApplication.shared

XCTAssertNil(application.currentViewController())
XCTAssertNil(application.currentViewController(from: nil))
}

func testCurrentViewController_viewController() {
let application = UIApplication.shared
let viewController = UIViewController()

XCTAssertNotNil(application.currentViewController(viewController))
XCTAssertNotNil(application.currentViewController(from: viewController))
}

func testCurrentViewController_navigationController() {
let application = UIApplication.shared
let viewController = UIViewController()
let navigation = UINavigationController(rootViewController: viewController)

XCTAssertNotNil(application.currentViewController(navigation))
XCTAssertNotNil(application.currentViewController(from: navigation))
}

func testCurrentViewController_tabController() {
Expand All @@ -52,7 +52,7 @@ final class UIApplicationTests: XCTestCase {

tab.viewControllers = [viewController]

XCTAssertNotNil(application.currentViewController(tab))
XCTAssertNotNil(application.currentViewController(from: tab))
}

func testCurrentViewController_tabController_3_viewcontroller() {
Expand All @@ -62,7 +62,7 @@ final class UIApplicationTests: XCTestCase {

tab.viewControllers = viewControllers

XCTAssertNotNil(application.currentViewController(tab))
XCTAssertNotNil(application.currentViewController(from: tab))
}

func testCurrentViewController_tabController_7_viewcontroller() {
Expand All @@ -73,6 +73,6 @@ final class UIApplicationTests: XCTestCase {
tab.viewControllers = viewControllers
tab.selectedIndex = 5

XCTAssertNotNil(application.currentViewController(tab))
XCTAssertNotNil(application.currentViewController(from: tab))
}
}
Loading