-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added unit test for isLinkingRelatedRequest function
- Loading branch information
1 parent
94d6ab6
commit f992c00
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// | ||
// BNCServerInterfaceTests.m | ||
// Branch-SDK-Tests | ||
// | ||
// Created by Nidhi Dixit on 1/7/25. | ||
// Copyright © 2025 Branch, Inc. All rights reserved. | ||
// | ||
|
||
#import <XCTest/XCTest.h> | ||
#import "Branch/BNCServerInterface.h" | ||
|
||
@interface BNCServerInterface() | ||
- (BOOL)isLinkingRelatedRequest:(NSString *)endpoint postParams:(NSDictionary *)post; | ||
@end | ||
|
||
@interface BNCServerInterfaceTests : XCTestCase | ||
@end | ||
|
||
@implementation BNCServerInterfaceTests | ||
|
||
- (void)testIsLinkingRelatedRequest { | ||
|
||
BNCServerInterface *serverInterface = [[BNCServerInterface alloc] init]; | ||
|
||
// install | ||
XCTAssertTrue([serverInterface isLinkingRelatedRequest:@"/v1/install" postParams:nil]); | ||
|
||
// open | ||
XCTAssertFalse([serverInterface isLinkingRelatedRequest:@"/v1/open" postParams:nil]); | ||
XCTAssertFalse([serverInterface isLinkingRelatedRequest:@"/v1/open" postParams:@{}]); | ||
XCTAssertTrue([serverInterface isLinkingRelatedRequest:@"/v1/open" postParams:@{@"spotlight_identifier":@"io.branch.link.v1.url.testbed.app.link/1234"}]); | ||
XCTAssertTrue([serverInterface isLinkingRelatedRequest:@"/v1/open" postParams:@{@"link_identifier": @"1305991233204308323"}]); | ||
XCTAssertTrue([serverInterface isLinkingRelatedRequest:@"/v1/open" postParams:@{@"universal_link_url":@"branchtest://open?_branch_referrer=H4sIAAAAAAAAA8soKSkottLXT8pLLkktLklKTd"}]); | ||
XCTAssertFalse([serverInterface isLinkingRelatedRequest:@"/v1/open" postParams:@{@"uri_scheme" : @"branchtest"}]); | ||
|
||
// v2/event | ||
XCTAssertFalse([serverInterface isLinkingRelatedRequest:@"/v2/event" postParams:@{@"spotlight_identifier":@"io.branch.link.v1.url.testbed.app.link/1234"}]); | ||
|
||
// v1/url | ||
XCTAssertTrue([serverInterface isLinkingRelatedRequest:@"/v1/url" postParams:nil]); | ||
|
||
} | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters