@@ -641,6 +641,50 @@ - (void)testCustomViewAdEvent {
641641 XCTAssert ([request.serverURL.absoluteString containsString: @" branch.io/v2/event/standard" ]);
642642}
643643
644+ - (void )testStandardOptInEvent {
645+ BranchEvent *event = [BranchEvent standardEvent: BranchStandardEventOptIn];
646+
647+ NSDictionary *eventDictionary = [event buildEventDictionary ];
648+ XCTAssertNotNil (eventDictionary);
649+ XCTAssert ([eventDictionary[@" name" ] isEqualToString: @" OPT_IN" ]);
650+
651+ BranchEventRequest *request = [event buildRequestWithEventDictionary: eventDictionary];
652+ XCTAssert ([request.serverURL.absoluteString containsString: @" branch.io/v2/event/standard" ]);
653+ }
654+
655+ - (void )testCustomOptInEvent {
656+ BranchEvent *event = [BranchEvent customEventWithName: @" OPT_IN" ];
657+
658+ NSDictionary *eventDictionary = [event buildEventDictionary ];
659+ XCTAssertNotNil (eventDictionary);
660+ XCTAssert ([eventDictionary[@" name" ] isEqualToString: @" OPT_IN" ]);
661+
662+ BranchEventRequest *request = [event buildRequestWithEventDictionary: eventDictionary];
663+ XCTAssert ([request.serverURL.absoluteString containsString: @" branch.io/v2/event/standard" ]);
664+ }
665+
666+ - (void )testStandardOptOutEvent {
667+ BranchEvent *event = [BranchEvent standardEvent: BranchStandardEventOptOut];
668+
669+ NSDictionary *eventDictionary = [event buildEventDictionary ];
670+ XCTAssertNotNil (eventDictionary);
671+ XCTAssert ([eventDictionary[@" name" ] isEqualToString: @" OPT_OUT" ]);
672+
673+ BranchEventRequest *request = [event buildRequestWithEventDictionary: eventDictionary];
674+ XCTAssert ([request.serverURL.absoluteString containsString: @" branch.io/v2/event/standard" ]);
675+ }
676+
677+ - (void )testCustomOptOutEvent {
678+ BranchEvent *event = [BranchEvent customEventWithName: @" OPT_OUT" ];
679+
680+ NSDictionary *eventDictionary = [event buildEventDictionary ];
681+ XCTAssertNotNil (eventDictionary);
682+ XCTAssert ([eventDictionary[@" name" ] isEqualToString: @" OPT_OUT" ]);
683+
684+ BranchEventRequest *request = [event buildRequestWithEventDictionary: eventDictionary];
685+ XCTAssert ([request.serverURL.absoluteString containsString: @" branch.io/v2/event/standard" ]);
686+ }
687+
644688- (void )testJsonStringForAdTypeNone {
645689 BranchEvent *event = [BranchEvent standardEvent: BranchStandardEventViewAd];
646690 XCTAssertNil ([event jsonStringForAdType: BranchEventAdTypeNone]);
0 commit comments