Skip to content

Commit

Permalink
Added settings dialog tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Gold872 committed Aug 19, 2023
1 parent b7aa52f commit 0d72b0d
Show file tree
Hide file tree
Showing 3 changed files with 472 additions and 34 deletions.
107 changes: 73 additions & 34 deletions test/test_util.mocks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
// Do not manually edit this file.

// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i5;
import 'dart:ui' as _i4;
import 'dart:async' as _i6;
import 'dart:ui' as _i5;

import 'package:elastic_dashboard/services/ds_interop.dart' as _i3;
import 'package:elastic_dashboard/services/nt4.dart' as _i2;
import 'package:elastic_dashboard/services/nt4_connection.dart' as _i3;
import 'package:elastic_dashboard/services/nt4_connection.dart' as _i4;
import 'package:mockito/mockito.dart' as _i1;

// ignore_for_file: type=lint
Expand Down Expand Up @@ -42,8 +43,9 @@ class _FakeNT4Client_1 extends _i1.SmartFake implements _i2.NT4Client {
);
}

class _FakeNT4Topic_2 extends _i1.SmartFake implements _i2.NT4Topic {
_FakeNT4Topic_2(
class _FakeDSInteropClient_2 extends _i1.SmartFake
implements _i3.DSInteropClient {
_FakeDSInteropClient_2(
Object parent,
Invocation parentInvocation,
) : super(
Expand All @@ -52,9 +54,19 @@ class _FakeNT4Topic_2 extends _i1.SmartFake implements _i2.NT4Topic {
);
}

class _FakeNT4SubscriptionOptions_3 extends _i1.SmartFake
class _FakeNT4Topic_3 extends _i1.SmartFake implements _i2.NT4Topic {
_FakeNT4Topic_3(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
}

class _FakeNT4SubscriptionOptions_4 extends _i1.SmartFake
implements _i2.NT4SubscriptionOptions {
_FakeNT4SubscriptionOptions_3(
_FakeNT4SubscriptionOptions_4(
Object parent,
Invocation parentInvocation,
) : super(
Expand All @@ -66,7 +78,7 @@ class _FakeNT4SubscriptionOptions_3 extends _i1.SmartFake
/// A class which mocks [NT4Connection].
///
/// See the documentation for Mockito's code generation for more information.
class MockNT4Connection extends _i1.Mock implements _i3.NT4Connection {
class MockNT4Connection extends _i1.Mock implements _i4.NT4Connection {
@override
_i2.NT4Subscription get allTopicsSubscription => (super.noSuchMethod(
Invocation.getter(#allTopicsSubscription),
Expand All @@ -89,13 +101,13 @@ class MockNT4Connection extends _i1.Mock implements _i3.NT4Connection {
returnValueForMissingStub: null,
);
@override
List<_i4.VoidCallback> get onConnectedListeners => (super.noSuchMethod(
List<_i5.VoidCallback> get onConnectedListeners => (super.noSuchMethod(
Invocation.getter(#onConnectedListeners),
returnValue: <_i4.VoidCallback>[],
returnValueForMissingStub: <_i4.VoidCallback>[],
) as List<_i4.VoidCallback>);
returnValue: <_i5.VoidCallback>[],
returnValueForMissingStub: <_i5.VoidCallback>[],
) as List<_i5.VoidCallback>);
@override
set onConnectedListeners(List<_i4.VoidCallback>? _onConnectedListeners) =>
set onConnectedListeners(List<_i5.VoidCallback>? _onConnectedListeners) =>
super.noSuchMethod(
Invocation.setter(
#onConnectedListeners,
Expand All @@ -104,14 +116,14 @@ class MockNT4Connection extends _i1.Mock implements _i3.NT4Connection {
returnValueForMissingStub: null,
);
@override
List<_i4.VoidCallback> get onDisconnectedListeners => (super.noSuchMethod(
List<_i5.VoidCallback> get onDisconnectedListeners => (super.noSuchMethod(
Invocation.getter(#onDisconnectedListeners),
returnValue: <_i4.VoidCallback>[],
returnValueForMissingStub: <_i4.VoidCallback>[],
) as List<_i4.VoidCallback>);
returnValue: <_i5.VoidCallback>[],
returnValueForMissingStub: <_i5.VoidCallback>[],
) as List<_i5.VoidCallback>);
@override
set onDisconnectedListeners(
List<_i4.VoidCallback>? _onDisconnectedListeners) =>
List<_i5.VoidCallback>? _onDisconnectedListeners) =>
super.noSuchMethod(
Invocation.setter(
#onDisconnectedListeners,
Expand All @@ -121,7 +133,7 @@ class MockNT4Connection extends _i1.Mock implements _i3.NT4Connection {
);
@override
bool get isNT4Connected => (super.noSuchMethod(
Invocation.getter(#isConnected),
Invocation.getter(#isNT4Connected),
returnValue: false,
returnValueForMissingStub: false,
) as bool);
Expand All @@ -138,23 +150,50 @@ class MockNT4Connection extends _i1.Mock implements _i3.NT4Connection {
),
) as _i2.NT4Client);
@override
bool get isDSConnected => (super.noSuchMethod(
Invocation.getter(#isDSConnected),
returnValue: false,
returnValueForMissingStub: false,
) as bool);
@override
_i3.DSInteropClient get dsClient => (super.noSuchMethod(
Invocation.getter(#dsClient),
returnValue: _FakeDSInteropClient_2(
this,
Invocation.getter(#dsClient),
),
returnValueForMissingStub: _FakeDSInteropClient_2(
this,
Invocation.getter(#dsClient),
),
) as _i3.DSInteropClient);
@override
void nt4Connect(String? ipAddress) => super.noSuchMethod(
Invocation.method(
#connect,
#nt4Connect,
[ipAddress],
),
returnValueForMissingStub: null,
);
@override
void addConnectedListener(_i4.VoidCallback? callback) => super.noSuchMethod(
void dsClientConnect(dynamic Function(String)? onIPAnnounced) =>
super.noSuchMethod(
Invocation.method(
#dsClientConnect,
[onIPAnnounced],
),
returnValueForMissingStub: null,
);
@override
void addConnectedListener(_i5.VoidCallback? callback) => super.noSuchMethod(
Invocation.method(
#addConnectedListener,
[callback],
),
returnValueForMissingStub: null,
);
@override
void addDisconnectedListener(_i4.VoidCallback? callback) =>
void addDisconnectedListener(_i5.VoidCallback? callback) =>
super.noSuchMethod(
Invocation.method(
#addDisconnectedListener,
Expand All @@ -163,14 +202,14 @@ class MockNT4Connection extends _i1.Mock implements _i3.NT4Connection {
returnValueForMissingStub: null,
);
@override
_i5.Stream<bool> connectionStatus() => (super.noSuchMethod(
_i6.Stream<bool> connectionStatus() => (super.noSuchMethod(
Invocation.method(
#connectionStatus,
[],
),
returnValue: _i5.Stream<bool>.empty(),
returnValueForMissingStub: _i5.Stream<bool>.empty(),
) as _i5.Stream<bool>);
returnValue: _i6.Stream<bool>.empty(),
returnValueForMissingStub: _i6.Stream<bool>.empty(),
) as _i6.Stream<bool>);
@override
void changeIPAddress(String? ipAddress) => super.noSuchMethod(
Invocation.method(
Expand Down Expand Up @@ -454,7 +493,7 @@ class MockNT4Client extends _i1.Mock implements _i2.NT4Client {
type,
],
),
returnValue: _FakeNT4Topic_2(
returnValue: _FakeNT4Topic_3(
this,
Invocation.method(
#publishNewTopic,
Expand All @@ -464,7 +503,7 @@ class MockNT4Client extends _i1.Mock implements _i2.NT4Client {
],
),
),
returnValueForMissingStub: _FakeNT4Topic_2(
returnValueForMissingStub: _FakeNT4Topic_3(
this,
Invocation.method(
#publishNewTopic,
Expand Down Expand Up @@ -566,11 +605,11 @@ class MockNT4Subscription extends _i1.Mock implements _i2.NT4Subscription {
@override
_i2.NT4SubscriptionOptions get options => (super.noSuchMethod(
Invocation.getter(#options),
returnValue: _FakeNT4SubscriptionOptions_3(
returnValue: _FakeNT4SubscriptionOptions_4(
this,
Invocation.getter(#options),
),
returnValueForMissingStub: _FakeNT4SubscriptionOptions_3(
returnValueForMissingStub: _FakeNT4SubscriptionOptions_4(
this,
Invocation.getter(#options),
),
Expand Down Expand Up @@ -612,14 +651,14 @@ class MockNT4Subscription extends _i1.Mock implements _i2.NT4Subscription {
returnValueForMissingStub: null,
);
@override
_i5.Stream<Object?> periodicStream() => (super.noSuchMethod(
_i6.Stream<Object?> periodicStream() => (super.noSuchMethod(
Invocation.method(
#periodicStream,
[],
),
returnValue: _i5.Stream<Object?>.empty(),
returnValueForMissingStub: _i5.Stream<Object?>.empty(),
) as _i5.Stream<Object?>);
returnValue: _i6.Stream<Object?>.empty(),
returnValueForMissingStub: _i6.Stream<Object?>.empty(),
) as _i6.Stream<Object?>);
@override
void updateValue(Object? value) => super.noSuchMethod(
Invocation.method(
Expand Down
Loading

0 comments on commit 0d72b0d

Please sign in to comment.