-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
42dd858
commit ab0fbd6
Showing
6 changed files
with
149 additions
and
84 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import 'package:flutter/cupertino.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:no_screenshot/no_screenshot_platform_interface.dart'; | ||
import 'package:no_screenshot/no_screenshot_method_channel.dart'; | ||
import 'package:plugin_platform_interface/plugin_platform_interface.dart'; | ||
|
||
class MockNoScreenshotPlatform | ||
with MockPlatformInterfaceMixin | ||
implements NoScreenshotPlatform { | ||
@override | ||
Future<bool> screenshotOff() async { | ||
// Mock implementation or return a fixed value | ||
return Future.value(true); | ||
} | ||
|
||
@override | ||
Future<bool> screenshotOn() async { | ||
// Mock implementation or return a fixed value | ||
return Future.value(true); | ||
} | ||
|
||
@override | ||
Future<bool> toggleScreenshot() async { | ||
// Mock implementation or return a fixed value | ||
return Future.value(true); | ||
} | ||
} | ||
|
||
Future<void> main() async { | ||
WidgetsFlutterBinding.ensureInitialized(); | ||
final NoScreenshotPlatform initialPlatform = NoScreenshotPlatform.instance; | ||
MockNoScreenshotPlatform fakePlatform = MockNoScreenshotPlatform(); | ||
|
||
test('$MethodChannelNoScreenshot is the default instance', () { | ||
expect(initialPlatform, isInstanceOf<MethodChannelNoScreenshot>()); | ||
}); | ||
|
||
test('screenshotOn', () async { | ||
expect(await fakePlatform.screenshotOn(), true); | ||
}); | ||
// screenshotOff | ||
test('screenshotOff', () async { | ||
expect(await fakePlatform.screenshotOff(), true); | ||
}); | ||
|
||
// toggleScreenshot | ||
test('toggleScreenshot', () async { | ||
expect(await fakePlatform.toggleScreenshot(), true); | ||
}); | ||
} |
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 was deleted.
Oops, something went wrong.