dart_class_wrapper

Creator: coderz1093

Last updated:

0 purchases

dart_class_wrapper Image
dart_class_wrapper Images

Languages

Categories

Add to Cart

Description:

dart class wrapper

Dart Class Wrapper #



Wrapper for a simplified partial mocking in Unit Tests.
Getting started #
Initialization
// Support a list of classes
@GenerateWithMethodSetters([AppData])
import 'file_test_name.wrapper.dart';

void main() {
group('Validate ....', () {
setUp(() => mock = WrapperAppData());

test('If ... Then ...', () {
// Original method `getStateDelta`
mock.mockGetStateDelta = (a, b) => 123.0;
// ....
});
});
}
copied to clipboard
Execution
# Cleanup autogenerated files
dart run build_runner clean
# Generate wrappers
dart run build_runner build --delete-conflicting-outputs
# Run tests
flutter test
copied to clipboard
In addition to thanking, you may treat us to ☕.

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.