Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hoc081098 committed Feb 8, 2021
1 parent 18707f9 commit 365f233
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 62 deletions.
4 changes: 2 additions & 2 deletions .idea/libraries/Dart_Packages.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dev_dependencies:
pedantic: ^1.10.0-nullsafety.3
test: ^1.16.0-nullsafety.12
collection: ^1.15.0-nullsafety.5
mockito: ^5.0.0-nullsafety.5
mockito: ^5.0.0-nullsafety.7
build_runner: ^1.11.0

# pub run build_runner build --delete-conflicting-outputs --enable-experiment=non-nullable
58 changes: 0 additions & 58 deletions test/value/value_controller.mocks.dart

This file was deleted.

2 changes: 1 addition & 1 deletion test/value/value_controller_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:mockito/mockito.dart';
import 'package:rxdart_ext/rxdart_ext.dart';
import 'package:test/test.dart';

import 'value_controller.mocks.dart';
import 'value_controller_test.mocks.dart';

// ignore_for_file: close_sinks

Expand Down
70 changes: 70 additions & 0 deletions test/value/value_controller_test.mocks.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// Mocks generated by Mockito 5.0.0-nullsafety.7 from annotations
// in rxdart_ext/test/value/value_controller_test.dart.
// Do not manually edit this file.

import 'dart:async' as _i2;

import 'package:mockito/mockito.dart' as _i1;

// ignore_for_file: comment_references
// ignore_for_file: unnecessary_parenthesis

class _FakeStreamSink<S> extends _i1.Fake implements _i2.StreamSink<S> {}

/// A class which mocks [StreamController].
///
/// See the documentation for Mockito's code generation for more information.
class MockStreamController<T> extends _i1.Mock
implements _i2.StreamController<T> {
MockStreamController() {
_i1.throwOnMissingStub(this);
}

@override
_i2.Stream<T> get stream => (super.noSuchMethod(Invocation.getter(#stream),
returnValue: Stream<T>.empty()) as _i2.Stream<T>);

@override
_i2.StreamSink<T> get sink => (super.noSuchMethod(Invocation.getter(#sink),
returnValue: _FakeStreamSink<T>()) as _i2.StreamSink<T>);

@override
bool get isClosed =>
(super.noSuchMethod(Invocation.getter(#isClosed), returnValue: false)
as bool);

@override
bool get isPaused =>
(super.noSuchMethod(Invocation.getter(#isPaused), returnValue: false)
as bool);

@override
bool get hasListener =>
(super.noSuchMethod(Invocation.getter(#hasListener), returnValue: false)
as bool);

@override
_i2.Future<dynamic> get done => (super.noSuchMethod(Invocation.getter(#done),
returnValue: Future.value(null)) as _i2.Future<dynamic>);

@override
void add(T? event) => super.noSuchMethod(Invocation.method(#add, [event]),
returnValueForMissingStub: null);

@override
void addError(Object? error, [StackTrace? stackTrace]) =>
super.noSuchMethod(Invocation.method(#addError, [error, stackTrace]),
returnValueForMissingStub: null);

@override
_i2.Future<dynamic> close() =>
(super.noSuchMethod(Invocation.method(#close, []),
returnValue: Future.value(null)) as _i2.Future<dynamic>);

@override
_i2.Future<dynamic> addStream(_i2.Stream<T>? source, {bool? cancelOnError}) =>
(super.noSuchMethod(
Invocation.method(
#addStream, [source], {#cancelOnError: cancelOnError}),
returnValue: Future.value(null)) as _i2.Future<dynamic>);
}

0 comments on commit 365f233

Please sign in to comment.