6c1420dd55f69d09f39dd213ee6c97ba901b8d92Craig McDonnell * The contents of this file are subject to the terms of the Common Development and
6c1420dd55f69d09f39dd213ee6c97ba901b8d92Craig McDonnell * Distribution License (the License). You may not use this file except in compliance with the
6c1420dd55f69d09f39dd213ee6c97ba901b8d92Craig McDonnell * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
6c1420dd55f69d09f39dd213ee6c97ba901b8d92Craig McDonnell * specific language governing permission and limitations under the License.
6c1420dd55f69d09f39dd213ee6c97ba901b8d92Craig McDonnell * When distributing Covered Software, include this CDDL Header Notice in each file and include
6c1420dd55f69d09f39dd213ee6c97ba901b8d92Craig McDonnell * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
6c1420dd55f69d09f39dd213ee6c97ba901b8d92Craig McDonnell * Header, with the fields enclosed by brackets [] replaced by your own identifying
6c1420dd55f69d09f39dd213ee6c97ba901b8d92Craig McDonnell * information: "Portions copyright [year] [name of copyright owner]".
6c1420dd55f69d09f39dd213ee6c97ba901b8d92Craig McDonnell * Copyright 2016 ForgeRock AS.
6c1420dd55f69d09f39dd213ee6c97ba901b8d92Craig McDonnell#import "FRANotificationGateway.h"
6c1420dd55f69d09f39dd213ee6c97ba901b8d92Craig McDonnell#import "FRANotificationHandler.h"
6c1420dd55f69d09f39dd213ee6c97ba901b8d92Craig McDonnell@interface FRANotificationGatewayTests : XCTestCase
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell@implementation FRANotificationGatewayTests {
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell FRANotificationGateway *notificationGateway;
6c1420dd55f69d09f39dd213ee6c97ba901b8d92Craig McDonnell mockApplication = OCMClassMock([UIApplication class]);
6c1420dd55f69d09f39dd213ee6c97ba901b8d92Craig McDonnell mockNotificationHandler = OCMClassMock([FRANotificationHandler class]);
6c1420dd55f69d09f39dd213ee6c97ba901b8d92Craig McDonnell notificationGateway = [FRANotificationGateway gatewayWithHandler:mockNotificationHandler];
6c1420dd55f69d09f39dd213ee6c97ba901b8d92Craig McDonnell- (void)testPropagatesPushNotificationsToRegisteredHandler {
6c1420dd55f69d09f39dd213ee6c97ba901b8d92Craig McDonnell [notificationGateway application:mockApplication didReceiveRemoteNotification:notification];
916ef74523ecddc8140815c084ab6971ee366bcfCraig McDonnell OCMVerify([mockNotificationHandler application:mockApplication didReceiveRemoteNotification:notification]);
6c1420dd55f69d09f39dd213ee6c97ba901b8d92Craig McDonnell- (void)testBackgroundPropagatesPushNotificationsToRegisteredHandler {
6c1420dd55f69d09f39dd213ee6c97ba901b8d92Craig McDonnell [notificationGateway application:mockApplication
6c1420dd55f69d09f39dd213ee6c97ba901b8d92Craig McDonnell fetchCompletionHandler:^(UIBackgroundFetchResult result){}];