Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 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 testSuccessfulLocalNotificationScheduling()
  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(toTriggerInMinutes: 1)
  37. mockLocalNotification2 = LocalNotification(toTriggerInMinutes: 2)
  38. let mockLocalNotifications = [mockLocalNotification1!, mockLocalNotification2!]
  39.  
  40. mockLocalNotificationManager?.schedule(notifications: mockLocalNotifications)
  41.  
  42. // When
  43. // ????
  44.  
  45. // Assert
  46. // ????
  47.  
  48. }
  49.  
  50. func testPerformance() {
  51. // This is an example of a performance test case.
  52. self.measure {
  53. // Put the code you want to measure the time of here.
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement