From 84b96d204e95cec04e15bab3a58c236cf3a41c19 Mon Sep 17 00:00:00 2001 From: Ivan Matkov Date: Thu, 15 Jun 2017 23:21:44 +0300 Subject: [PATCH] Fix unit test --- Support/HockeySDKTests/BITMetricsManagerTests.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Support/HockeySDKTests/BITMetricsManagerTests.m b/Support/HockeySDKTests/BITMetricsManagerTests.m index 7ebfb764ad..8db7dbbe59 100644 --- a/Support/HockeySDKTests/BITMetricsManagerTests.m +++ b/Support/HockeySDKTests/BITMetricsManagerTests.m @@ -78,7 +78,8 @@ self.sut = [BITMetricsManager new]; [self.sut startManager]; - [verify((id)self.mockNotificationCenter) addObserverForName:UIApplicationDidEnterBackgroundNotification object:nil queue:NSOperationQueue.mainQueue usingBlock:(id)anything()]; + // 1 for BITMetricsManager + 1 for BITChannel + [verifyCount((id)self.mockNotificationCenter, times(2)) addObserverForName:UIApplicationDidEnterBackgroundNotification object:nil queue:NSOperationQueue.mainQueue usingBlock:(id)anything()]; [verify((id)self.mockNotificationCenter) addObserverForName:UIApplicationWillEnterForegroundNotification object:nil queue:NSOperationQueue.mainQueue usingBlock:(id)anything()]; }