dart_class_wrapper 1.0.0 copy "dart_class_wrapper: ^1.0.0" to clipboard
dart_class_wrapper: ^1.0.0 copied to clipboard

Wrapper for a simplified partial mocking in Unit Tests

Dart Class Wrapper #

Test Status Build Status

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;
      // .... 
    });
  });
}

Execution

# Cleanup autogenerated files
dart run build_runner clean
# Generate wrappers
dart run build_runner build --delete-conflicting-outputs
# Run tests
flutter test

In addition to thanking, you may treat us to ☕.

1
likes
140
pub points
35%
popularity

Publisher

verified publishertercad.com

Wrapper for a simplified partial mocking in Unit Tests

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

analyzer, build, source_gen

More

Packages that depend on dart_class_wrapper