mock_of_context 1.1.0 copy "mock_of_context: ^1.1.0" to clipboard
mock_of_context: ^1.1.0 copied to clipboard

discontinued
outdated

Mock of Context is a companion project for testing Out of Context.

Mock of Context - Companion project for Out Of Context #

Mock of Context Build Codecov Pub Dev Documentation

Please view the stable brunch for a production version.


Using mock_of_context #

To import the library, add the following dependency to your project.

dev_dependencies:
  mock_of_context: ^1.1.0

Then, use any of the Mixins provided to mock a mixin from Out of Context.

import 'package:flutter_test/flutter_test.dart';
import 'package:mockito/mockito.dart';
import 'package:mock_of_context/mock_of_context.dart';

import 'package:out_of_context/out_of_context.dart';

class Fancy with RouterMixin {

  void back() => router.pop();

}

class StubFancy extends Fancy with MockRouterMixin {}

void main() {
  
  test('example', () {
    final fancy = StubFancy()..pop();
    verify(fancy.router.pop());
  });

}
0
likes
0
points
2
downloads

Publisher

verified publisherforuslabs.com

Weekly Downloads

Mock of Context is a companion project for testing Out of Context.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, meta, mockito, out_of_context

More

Packages that depend on mock_of_context