mock_of_context 2.0.0 icon indicating copy to clipboard operation
mock_of_context: ^2.0.0 copied to clipboard

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.2.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 DispatcherMixin {

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

}

class StubFancy extends Fancy with MockDispatcherMixin {}

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

}
0
likes
120
pub points
0%
popularity

Publisher

verified publisher iconforuslabs.com

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

Repository (GitHub)

Documentation

API reference

License

Icon for licenses.MIT (LICENSE)

Dependencies

flutter, meta, mockito, out_of_context

More

Packages that depend on mock_of_context