Skip to content

Commit

Permalink
Added the mediation folder to the pubignore file
Browse files Browse the repository at this point in the history
  • Loading branch information
LTPhantom committed Jan 18, 2024
1 parent 03159b5 commit 230a1ba
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 11 deletions.
1 change: 1 addition & 0 deletions packages/google_mobile_ads/.pubignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# Mediation packages are published independently
mediation/
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: gma_mediation_unity
description: "Mediation Adapter for Unity Ads to use with Google Mobile Ads."
version: 1.0.0-alpha.1
version: 1.0.0
repository: https://github.com/googleads/googleads-mobile-flutter/tree/main/packages/google_mobile_ads/mediation

environment:
Expand All @@ -10,8 +10,7 @@ environment:
dependencies:
flutter:
sdk: flutter
google_mobile_ads:
path: ../../
google_mobile_ads: ^4.0.0
plugin_platform_interface: ^2.0.2

dev_dependencies:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,44 @@
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:unity/unity_method_channel.dart';
import 'package:gma_mediation_unity/unity_adapter.dart';

void main() {
TestWidgetsFlutterBinding.ensureInitialized();

MethodChannelUnity platform = MethodChannelUnity();
final List<MethodCall> log = <MethodCall>[];
const MethodChannel channel = MethodChannel('unity');

setUp(() {
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockMethodCallHandler(
log.clear();
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
.setMockMethodCallHandler(
channel,
(MethodCall methodCall) async {
return '42';
log.add(methodCall);
switch (methodCall.method) {
case 'setGDPRConsent':
case 'setCCPAConsent':
return null;
default:
assert(false);
return null;
}
},
);
});

tearDown(() {
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockMethodCallHandler(channel, null);
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
.setMockMethodCallHandler(channel, null);
});

test('$UnityAdapter.setGDPRConsent', () async {
UnityAdapter.setGDPRConsent(true);
UnityAdapter.setGDPRConsent(false);

expect(log, <Matcher>[
isMethodCall('setGDPRConsent', arguments: {'gdprConsent': true}),
isMethodCall('setGDPRConsent', arguments: {'gdprConsent': false})
]);
});
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:unity/unity_adapter.dart';
import 'package:unity/unity_platform_interface.dart';
import 'package:unity/unity_method_channel.dart';
import 'package:gma_mediation_unity/unity_adapter.dart';
import 'package:gma_mediation_unity/unity_platform_interface.dart';
import 'package:gma_mediation_unity/unity_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockUnityPlatform
Expand Down

0 comments on commit 230a1ba

Please sign in to comment.