-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added missing unit test for [AMAReporter privacyTimerDidFire:]
2d3ffb7f723d0eeba20bc557cad2c66ea4f92c1f
- Loading branch information
alex-oleynik
committed
May 21, 2024
1 parent
2456d2f
commit b70e855
Showing
9 changed files
with
182 additions
and
12 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
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
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
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
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
19 changes: 19 additions & 0 deletions
19
AppMetricaCore/Tests/Utilities/AMAReporter+TestUtilities.h
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,19 @@ | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "AMAReporter.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface AMAReporter (TestUtilities) | ||
|
||
- (instancetype)initWithApiKey:(NSString *)apiKey | ||
main:(BOOL)main | ||
reporterStorage:(AMAReporterStorage *)reporterStorage | ||
eventBuilder:(AMAEventBuilder *)eventBuilder | ||
internalReporter:(AMAInternalEventsReporter *)internalReporter | ||
attributionCheckExecutor:(id<AMAAsyncExecuting>)attributionCheckExecutor | ||
privacyTimer:(AMAPrivacyTimer *)privacyTimer; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
50 changes: 50 additions & 0 deletions
50
AppMetricaCore/Tests/Utilities/AMAReporter+TestUtilities.m
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,50 @@ | ||
|
||
#import "AMAReporter+TestUtilities.h" | ||
#import "AMAAdServicesDataProvider.h" | ||
#import "AMASessionExpirationHandler.h" | ||
#import "AMAMetricaConfiguration.h" | ||
#import "AMAAdProvider.h" | ||
#import "AMAECommerceSerializer.h" | ||
#import "AMAECommerceTruncator.h" | ||
#import "AMAExternalAttributionSerializer.h" | ||
|
||
@implementation AMAReporter (TestUtilities) | ||
|
||
- (instancetype)initWithApiKey:(NSString *)apiKey | ||
main:(BOOL)main | ||
reporterStorage:(AMAReporterStorage *)reporterStorage | ||
eventBuilder:(AMAEventBuilder *)eventBuilder | ||
internalReporter:(AMAInternalEventsReporter *)internalReporter | ||
attributionCheckExecutor:(id<AMAAsyncExecuting>)attributionCheckExecutor | ||
privacyTimer:(AMAPrivacyTimer *)privacyTimer | ||
{ | ||
AMACancelableDelayedExecutor *executor = [[AMACancelableDelayedExecutor alloc] initWithIdentifier:self]; | ||
|
||
AMAAdServicesDataProvider *adServicesDataProvider = nil; | ||
if (@available(iOS 14.3, *)) { | ||
adServicesDataProvider = [[AMAAdServicesDataProvider alloc] init]; | ||
} | ||
|
||
AMASessionExpirationHandler *sessionExpirationHandler = | ||
[[AMASessionExpirationHandler alloc] initWithConfiguration:[AMAMetricaConfiguration sharedInstance] | ||
APIKey:apiKey]; | ||
|
||
AMAAdProvider *adProvider = [AMAAdProvider sharedInstance]; | ||
|
||
return [self initWithApiKey:apiKey | ||
main:main | ||
reporterStorage:reporterStorage | ||
eventBuilder:eventBuilder | ||
internalReporter:internalReporter | ||
executor:executor | ||
attributionCheckExecutor:attributionCheckExecutor | ||
eCommerceSerializer:[[AMAECommerceSerializer alloc] init] | ||
eCommerceTruncator:[[AMAECommerceTruncator alloc] init] | ||
adServices:adServicesDataProvider | ||
externalAttributionSerializer:[[AMAExternalAttributionSerializer alloc] init] | ||
sessionExpirationHandler:sessionExpirationHandler | ||
adProvider:adProvider | ||
privacyTimer:privacyTimer]; | ||
} | ||
|
||
@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
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