Guest User

Untitled

a guest
Jun 24th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. - (void)testNotificationWhenEditingNonTodayStat
  2. {
  3. // given
  4. id mock = [OCMockObject observerMock];
  5. [[NSNotificationCenter defaultCenter] addMockObserver:mock name:FGNPastStatWasUpgraded object:nil];
  6. [[mock expect] notificationWithName:FGNPastStatWasUpgraded object:nil];
  7. _this.date = [DLCommon dateFromString:@"2010-04-01"];
  8.  
  9. // when
  10. _this.reviewedValue++;
  11.  
  12. // then
  13. [mock verify];
  14. [[NSNotificationCenter defaultCenter] removeObserver:mock];
  15. }
  16.  
  17. - (void)testNotificationNotSentWhenEditingTodayStats
  18. {
  19. // given
  20. id mock = [OCMockObject observerMock];
  21. [[NSNotificationCenter defaultCenter] addMockObserver:mock name:FGNPastStatWasUpgraded object:nil];
  22. _this.date = TODAY;
  23.  
  24. // when
  25. _this.reviewedValue++;
  26.  
  27. // then
  28. [mock verify];
  29. [[NSNotificationCenter defaultCenter] removeObserver:mock];
  30. }
Add Comment
Please, Sign In to add comment