Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. class LocalNotificationTests: XCTestCase {
  2.  
  3. var mockLocalNotification1: LocalNotification?
  4. var mockLocalNotification2: LocalNotification?
  5.  
  6. // This is the manager I use for scheduling notifications.
  7. // Implementation details are trivial.
  8. var mockLocalNotificationManager: XECALocalNotificationManagerDelegate?
  9.  
  10. override func setUp()
  11. {
  12. super.setUp()
  13.  
  14. let mockLocalNotificationManager = LocalNotificationManager()
  15. }
  16.  
  17. override func tearDown()
  18. {
  19. super.tearDown()
  20.  
  21. mockLocalNotificationManager = nil
  22. }
  23.  
  24. // MARK: - Test Functions
  25.  
  26. func testSuccessfulGeoSensitiveNotificationScheduling()
  27. {
  28.  
  29. // Given
  30.  
  31.  
  32. // I don't believe that this will work
  33. UserDefaults.standard.set("US", forKey: "regionCode")
  34. UserDefaults.standard.synchronize()
  35.  
  36. mockLocalNotification1 = LocalNotification(withID: "mockLocalNotification1", toTriggerInMinutes: 1, requiresLocation: true)
  37. mockLocalNotification2 = LocalNotification(withID: "mockLocalNotification2", toTriggerInMinutes: 2, requiresLocation: true)
  38. mockLocalNotificationManager?.schedule(notifications: [mockLocalNotification1!, mockLocalNotification2!])
  39.  
  40. // When
  41. // ????
  42.  
  43. // Assert
  44. // ????
  45.  
  46. }
  47.  
  48. func testPerformance() {
  49. // This is an example of a performance test case.
  50. self.measure {
  51. // Put the code you want to measure the time of here.
  52. }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement