This commit is contained in:
sabrinaj206 2017-07-10 18:20:54 -07:00
Родитель 2e40c74a1b
Коммит add1d40ebc
6 изменённых файлов: 45 добавлений и 50 удалений

Просмотреть файл

@ -32,5 +32,4 @@ class demoapp_ios_swift: XCTestCase {
// Use recording to get started writing UI tests.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
}

Просмотреть файл

@ -43,9 +43,9 @@ class AnalyticsViewController: UIViewController {
// OK Button
alert.addAction(UIAlertAction(title: "OK",
style: .default,
handler: { (action) in alert.dismiss(animated: true, completion: nil)
handler: { _ in alert.dismiss(animated: true, completion: nil)
}))
self.present(alert, animated:true, completion: nil)
present(alert, animated: true, completion: nil)
}
func presentColorPropertyAlert() {
@ -57,7 +57,7 @@ class AnalyticsViewController: UIViewController {
// Yellow button
alert.addAction(UIAlertAction(title: "Yellow",
style: .default,
handler: { (action) in alert.dismiss(animated: true, completion: nil)
handler: { _ in alert.dismiss(animated: true, completion: nil)
}))
// sent yellow event here
MSAnalytics.trackEvent("Color event", withProperties: ["Color": "Yellow"])
@ -65,7 +65,7 @@ class AnalyticsViewController: UIViewController {
// Blue button
alert.addAction(UIAlertAction(title: "Blue",
style: .default,
handler: { (action) in alert.dismiss(animated: true, completion: nil)
handler: { _ in alert.dismiss(animated: true, completion: nil)
}))
// sent blue event here
MSAnalytics.trackEvent("Color event", withProperties: ["Color": "Blue"])
@ -73,11 +73,11 @@ class AnalyticsViewController: UIViewController {
// Red button
alert.addAction(UIAlertAction(title: "Red",
style: .default,
handler: { (action) in alert.dismiss(animated: true, completion: nil)
handler: { _ in alert.dismiss(animated: true, completion: nil)
}))
// sent red event here
MSAnalytics.trackEvent("Color event", withProperties: ["Color": "Red"])
self.present(alert, animated:true, completion: nil)
present(alert, animated: true, completion: nil)
}
}

Просмотреть файл

@ -15,7 +15,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
MSMobileCenter.start("<APP SECRET HERE>", withServices: [
MSAnalytics.self,
MSCrashes.self,
MSPush.self
MSPush.self,
])
return true
}

Просмотреть файл

@ -28,18 +28,17 @@ class CrashViewController: UIViewController {
// Cancel Button
alert.addAction(UIAlertAction(title: "Cancel",
style: UIAlertActionStyle.default,
handler: { (action) in alert.dismiss(animated: true, completion: nil)
handler: { _ in alert.dismiss(animated: true, completion: nil)
}))
// Crash App button
alert.addAction(UIAlertAction(title: "Crash app",
style: UIAlertActionStyle.destructive,
handler: { (action) in alert.dismiss(animated: true, completion: nil)
handler: { _ in alert.dismiss(animated: true, completion: nil)
// generate test crash
MSCrashes.generateTestCrash()
fatalError()
}))
self.present(alert, animated:true, completion: nil)
present(alert, animated: true, completion: nil)
}
}

Просмотреть файл

@ -26,5 +26,4 @@ class demoapp_ios_swiftTests: XCTestCase {
let vc = CrashViewController()
XCTAssertNotNil(vc.view, "View did not load for CrashViewController.")
}
}

Просмотреть файл

@ -19,7 +19,6 @@ class demoapp_ios_swiftUITests: XCTestCase {
continueAfterFailure = false
// UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
XCUIApplication().launch()
}
override func tearDown() {
@ -30,5 +29,4 @@ class demoapp_ios_swiftUITests: XCTestCase {
func testTrue() {
XCTAssert(true)
}
}