Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Releases/v0.12.0 #34

Merged
merged 5 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 28 additions & 6 deletions Example/DemoAppTests/MuxImaListener_Test.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,24 @@ @interface MuxMockImaAdEvent : IMAAdEvent {
enum IMAAdEventType type;
}
@property (nonatomic) enum IMAAdEventType type;
@property(nonatomic, copy, nullable) NSDictionary<NSString *, id> *adData;
@end

@implementation MuxMockImaAdEvent

@synthesize type;
@synthesize adData;

- (id)initWithType:(NSInteger)_type {
type = _type;
return self;
}

- (id)initWithType:(NSInteger)_type andAdData:(NSDictionary*)_adData {
type = _type;
adData = _adData;
return self;
}
@end

SpecBegin(InitialSpecs)
Expand Down Expand Up @@ -77,12 +85,6 @@ - (id)initWithType:(NSInteger)_type {
imaListener = [[MuxImaListener alloc] initWithPlayerBinding:playerBinding];
});

it(@"should dispatch the correct event for kIMAAdEvent_LOADED", ^{
MuxMockImaAdEvent *adEvent = [[MuxMockImaAdEvent alloc] initWithType:kIMAAdEvent_LOADED];
MUXSDKPlaybackEvent *playbackEvent = [imaListener dispatchEvent:adEvent];
expect(playbackEvent).to.beKindOf([MUXSDKAdPlayEvent class]);
});

it(@"should dispatch the correct event for kIMAAdEvent_STARTED", ^{
MuxMockImaAdEvent *adEvent = [[MuxMockImaAdEvent alloc] initWithType:kIMAAdEvent_STARTED];
MUXSDKPlaybackEvent *playbackEvent = [imaListener dispatchEvent:adEvent];
Expand Down Expand Up @@ -124,6 +126,26 @@ - (id)initWithType:(NSInteger)_type {
MUXSDKPlaybackEvent *playbackEvent = [imaListener dispatchEvent:adEvent];
expect(playbackEvent).to.beKindOf([MUXSDKAdPauseEvent class]);
});

it(@"should not dispatch aderror for LOG event *without* error info", ^{
MuxMockImaAdEvent *adEvent = [[MuxMockImaAdEvent alloc] initWithType:kIMAAdEvent_LOG];
MUXSDKPlaybackEvent *playbackEvent = [imaListener dispatchEvent:adEvent];
expect(playbackEvent).to.beNil();
});

it(@"should dispatch aderror for LOG event with error info", ^{
NSMutableDictionary *mockErrorData = [[NSMutableDictionary alloc] init];
[mockErrorData setObject:[NSNumber numberWithInt:110] forKey:@"errorCode"];
[mockErrorData setObject:@"mock message" forKey:@"errorMessage"];
[mockErrorData setObject:@"adPlayError" forKey:@"type"];
NSMutableDictionary *mockLogData = [[NSMutableDictionary alloc] init];
[mockLogData setObject:mockErrorData forKey:@"logData"];

MuxMockImaAdEvent *adEvent = [[MuxMockImaAdEvent alloc] initWithType:kIMAAdEvent_LOG andAdData:mockLogData];

MUXSDKPlaybackEvent *playbackEvent = [imaListener dispatchEvent:adEvent];
expect(playbackEvent).to.beKindOf([MUXSDKAdErrorEvent class]);
});

it(@"should not dispatch an event for kIMAAdEvent_TAPPED", ^{
MuxMockImaAdEvent *adEvent = [[MuxMockImaAdEvent alloc] initWithType:kIMAAdEvent_TAPPED];
Expand Down
20 changes: 10 additions & 10 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
PODS:
- Expecta (1.0.6)
- GoogleAds-IMA-iOS-SDK (3.19.2)
- GoogleAds-IMA-iOS-SDK (3.20.0)
- GoogleAds-IMA-tvOS-SDK (4.9.1)
- Mux-Stats-AVPlayer (3.3.1):
- Mux-Stats-Core (~> 4.5.2)
- Mux-Stats-Core (4.5.2)
- Mux-Stats-Google-IMA (0.11.0):
- Mux-Stats-AVPlayer (3.5.1):
- Mux-Stats-Core (= 4.6.0)
- Mux-Stats-Core (4.6.0)
- Mux-Stats-Google-IMA (0.12.0):
- GoogleAds-IMA-iOS-SDK (~> 3.16)
- GoogleAds-IMA-tvOS-SDK (~> 4.6)
- Mux-Stats-AVPlayer (~> 3.2)
Expand All @@ -31,13 +31,13 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
Expecta: 3b6bd90a64b9a1dcb0b70aa0e10a7f8f631667d5
GoogleAds-IMA-iOS-SDK: 0e817c05ab26f1b9285c80f4a75e1350a916d50b
GoogleAds-IMA-iOS-SDK: f9a6bd69e34f6c3a2d6b2f7cd56814b78fc680f9
GoogleAds-IMA-tvOS-SDK: 85e799c35051454693492480ef7e4ae2e701a05f
Mux-Stats-AVPlayer: 033434ccaffc9698d5566ce3563ac1d02bcbd0de
Mux-Stats-Core: b747ca415f883e2b2d9475d8cc0ac3079167bf6b
Mux-Stats-Google-IMA: 91c02f85386b84aa926594a7bca149b9b124fdb0
Mux-Stats-AVPlayer: 1b1a877e5d8b57ca22e0717fa0a4eefef7529c40
Mux-Stats-Core: 53902e414f077b2239ea10d909a4cf072c0d4d5c
Mux-Stats-Google-IMA: 713958837a4dece8ea14d425db548449af2c4fe1
Specta: b79d84043684b35ffdc2680df578dc318ec2efc2

PODFILE CHECKSUM: f1623162f4611830718c2a3afabe15d9f3efda6c

COCOAPODS: 1.12.1
COCOAPODS: 1.13.0
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading