mirror of
https://github.com/zhigang1992/facebook-ios-sdk.git
synced 2026-01-12 17:22:28 +08:00
Summary: - TestTools is now 100% Swift - FBSDKCoreKit imports had to be added since it was no longer imported globally via TestTools.h - A few line breaks had to be added above the new import to prevent the "Imports should be sorted" violation from SwiftLint Reviewed By: samodom Differential Revision: D40077738 fbshipit-source-id: 2cb5cbeceb90214f58fa0f6fe635eef133faa336
51 lines
1.1 KiB
Swift
51 lines
1.1 KiB
Swift
/*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
@testable import FBSDKCoreKit
|
|
|
|
import TestTools
|
|
import XCTest
|
|
|
|
final class AppEventsDeviceInfoTests: XCTestCase {
|
|
|
|
// swiftlint:disable implicitly_unwrapped_optional
|
|
var deviceInfo: _AppEventsDeviceInfo!
|
|
var settings: TestSettings!
|
|
// swiftlint:enable implicitly_unwrapped_optional
|
|
|
|
override func setUp() {
|
|
super.setUp()
|
|
|
|
settings = TestSettings()
|
|
deviceInfo = _AppEventsDeviceInfo()
|
|
deviceInfo.configure(settings: settings)
|
|
}
|
|
|
|
override func tearDown() {
|
|
settings = nil
|
|
deviceInfo = nil
|
|
|
|
super.tearDown()
|
|
}
|
|
|
|
func testDefaultDependencies() {
|
|
deviceInfo = _AppEventsDeviceInfo()
|
|
XCTAssertNil(
|
|
deviceInfo.settings,
|
|
"Should not have settings by default"
|
|
)
|
|
}
|
|
|
|
func testConfiguringWithDependencies() {
|
|
XCTAssertTrue(
|
|
deviceInfo.settings === settings,
|
|
"Should use the provided settings"
|
|
)
|
|
}
|
|
}
|