Skip to content

Commit

Permalink
chore: better names for test objects
Browse files Browse the repository at this point in the history
  • Loading branch information
XavierChanth committed Nov 15, 2023
1 parent 012de5a commit 71baab0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
24 changes: 12 additions & 12 deletions packages/noports_core/test/sshnp/sshnp_core_mocks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,35 +60,35 @@ class StubbedSshnpCore extends SshnpCore with StubbedAsyncInitializationMixin {

/// Stubbed mixin wrapper
mixin StubbedAsyncInitializationMixin on AsyncInitialization {
late FunctionStub _mockCallInitialization;
late FunctionStub _mockInitialize;
late FunctionStub _mockCompleteInitialization;
late FunctionStub _stubbedCallInitialization;
late FunctionStub _stubbedInitialize;
late FunctionStub _stubbedCompleteInitialization;

void stubAsyncInitialization({
required FunctionStub mockCallInitialization,
required FunctionStub mockInitialize,
required FunctionStub mockCompleteInitialization,
required FunctionStub stubbedCallInitialization,
required FunctionStub stubbedInitialize,
required FunctionStub stubbedCompleteInitialization,
}) {
_mockCallInitialization = mockCallInitialization;
_mockInitialize = mockInitialize;
_mockCompleteInitialization = mockCompleteInitialization;
_stubbedCallInitialization = stubbedCallInitialization;
_stubbedInitialize = stubbedInitialize;
_stubbedCompleteInitialization = stubbedCompleteInitialization;
}

@override
Future<void> callInitialization() async {
_mockCallInitialization.call();
_stubbedCallInitialization.call();
return super.callInitialization();
}

@override
Future<void> initialize() async {
_mockInitialize.call();
_stubbedInitialize.call();
await super.initialize();
}

@override
void completeInitialization() {
_mockCompleteInitialization.call();
_stubbedCompleteInitialization.call();
super.completeInitialization();
}
}
6 changes: 3 additions & 3 deletions packages/noports_core/test/sshnp/sshnp_core_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ void main() {

/// Setup stubs for the mocks that are part of [MockAsyncInitializationMixin]
sshnpCore.stubAsyncInitialization(
mockCallInitialization: stubbedCallInitialization,
mockCompleteInitialization: stubbedCompleteInitialization,
mockInitialize: stubbedInitialize,
stubbedCallInitialization: stubbedCallInitialization,
stubbedCompleteInitialization: stubbedCompleteInitialization,
stubbedInitialize: stubbedInitialize,
);

whenInitialization(identityKeyPair: sshnpCore.identityKeyPair);
Expand Down

0 comments on commit 71baab0

Please sign in to comment.