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