Skip to content

Commit

Permalink
♻️ Refactor counter presenter and increment counter services in tests
Browse files Browse the repository at this point in the history
Signed-off-by: Dmytro Turskyi <[email protected]>
  • Loading branch information
Turskyi committed Aug 7, 2024
1 parent 51e55df commit 3eb7743
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions test/counter_presenter_test.dart
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import 'package:async/async.dart';
import 'package:counter_with_onion_architecture/core/application_services/counter_presenter.dart';
import 'package:counter_with_onion_architecture/core/domain/model/counter.dart';
import 'package:counter_with_onion_architecture/core/domain/services/increment_counter.dart';
import 'package:counter_with_onion_architecture/core/domain/services/increment_counter_fake_impl.dart';
import 'package:counter_with_onion_architecture/infrastructure/counter_data_source.dart';
import 'package:counter_with_onion_architecture/infrastructure/fake_counter_data_source.dart';
import 'package:flutter_test/flutter_test.dart';

void main() {
test('CounterPresenter should update the counter', () async {
final FakeCounterDataSource dataSource = FakeCounterDataSource();
final IncrementCounterFakeImpl incrementCounter = IncrementCounterFakeImpl(
final CounterDataSource dataSource = FakeCounterDataSource();
final IncrementCounter incrementCounter = IncrementCounterFakeImpl(
dataSource,
);
final CounterPresenter presenter = CounterPresenter(incrementCounter);
Expand Down
6 changes: 4 additions & 2 deletions test/increment_counter_test.dart
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import 'package:async/async.dart';
import 'package:counter_with_onion_architecture/core/application_services/counter_presenter.dart';
import 'package:counter_with_onion_architecture/core/domain/model/counter.dart';
import 'package:counter_with_onion_architecture/core/domain/services/increment_counter.dart';
import 'package:counter_with_onion_architecture/core/domain/services/increment_counter_fake_impl.dart';
import 'package:counter_with_onion_architecture/infrastructure/counter_data_source.dart';
import 'package:counter_with_onion_architecture/infrastructure/fake_counter_data_source.dart';
import 'package:flutter_test/flutter_test.dart';

void main() {
test('CounterPresenter should update the counter', () async {
final FakeCounterDataSource dataSource = FakeCounterDataSource();
final IncrementCounterFakeImpl incrementCounter = IncrementCounterFakeImpl(
final CounterDataSource dataSource = FakeCounterDataSource();
final IncrementCounter incrementCounter = IncrementCounterFakeImpl(
dataSource,
);
final CounterPresenter presenter = CounterPresenter(incrementCounter);
Expand Down

0 comments on commit 3eb7743

Please sign in to comment.