mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-24 08:20:40 +00:00
Compare commits
No commits in common. "33274ad1f6f7916537801bf8f859c077f2121601" and "2a7463184bc2e8c2d2eaa8ff1201c8848e826753" have entirely different histories.
33274ad1f6
...
2a7463184b
4 changed files with 6 additions and 94 deletions
|
@ -25,17 +25,20 @@ void main() {
|
||||||
late MeteringBloc bloc;
|
late MeteringBloc bloc;
|
||||||
const iso100 = IsoValue(100, StopType.full);
|
const iso100 = IsoValue(100, StopType.full);
|
||||||
|
|
||||||
setUp(() {
|
setUpAll(() {
|
||||||
meteringInteractor = _MockMeteringInteractor();
|
meteringInteractor = _MockMeteringInteractor();
|
||||||
|
communicationBloc = _MockMeteringCommunicationBloc();
|
||||||
|
|
||||||
when<IsoValue>(() => meteringInteractor.iso).thenReturn(iso100);
|
when<IsoValue>(() => meteringInteractor.iso).thenReturn(iso100);
|
||||||
when<NdValue>(() => meteringInteractor.ndFilter).thenReturn(NdValue.values.first);
|
when<NdValue>(() => meteringInteractor.ndFilter).thenReturn(NdValue.values.first);
|
||||||
when<Film>(() => meteringInteractor.film).thenReturn(Film.values.first);
|
when<Film>(() => meteringInteractor.film).thenReturn(Film.values.first);
|
||||||
|
|
||||||
when(meteringInteractor.quickVibration).thenAnswer((_) async {});
|
when(meteringInteractor.quickVibration).thenAnswer((_) async {});
|
||||||
when(meteringInteractor.responseVibration).thenAnswer((_) async {});
|
when(meteringInteractor.responseVibration).thenAnswer((_) async {});
|
||||||
when(meteringInteractor.errorVibration).thenAnswer((_) async {});
|
when(meteringInteractor.errorVibration).thenAnswer((_) async {});
|
||||||
|
});
|
||||||
|
|
||||||
communicationBloc = _MockMeteringCommunicationBloc();
|
setUp(() {
|
||||||
|
|
||||||
bloc = MeteringBloc(
|
bloc = MeteringBloc(
|
||||||
meteringInteractor,
|
meteringInteractor,
|
||||||
communicationBloc,
|
communicationBloc,
|
||||||
|
@ -44,7 +47,6 @@ void main() {
|
||||||
|
|
||||||
tearDown(() {
|
tearDown(() {
|
||||||
bloc.close();
|
bloc.close();
|
||||||
communicationBloc.close();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
group(
|
group(
|
||||||
|
@ -469,7 +471,6 @@ void main() {
|
||||||
verify: (_) {
|
verify: (_) {
|
||||||
verify(() => meteringInteractor.film = const Film.other()).called(1);
|
verify(() => meteringInteractor.film = const Film.other()).called(1);
|
||||||
verifyNever(() => meteringInteractor.iso = const IsoValue(0, StopType.full));
|
verifyNever(() => meteringInteractor.iso = const IsoValue(0, StopType.full));
|
||||||
verifyNever(() => meteringInteractor.responseVibration());
|
|
||||||
},
|
},
|
||||||
expect: () => [
|
expect: () => [
|
||||||
isA<MeteringDataState>()
|
isA<MeteringDataState>()
|
||||||
|
|
|
@ -46,7 +46,6 @@ void main() {
|
||||||
bloc.add(const MeteringInProgressEvent(2));
|
bloc.add(const MeteringInProgressEvent(2));
|
||||||
bloc.add(const MeasureEvent());
|
bloc.add(const MeasureEvent());
|
||||||
bloc.add(const MeteringEndedEvent(2));
|
bloc.add(const MeteringEndedEvent(2));
|
||||||
bloc.add(const MeteringEndedEvent(2));
|
|
||||||
},
|
},
|
||||||
expect: () => [
|
expect: () => [
|
||||||
isA<MeasureState>(),
|
isA<MeasureState>(),
|
||||||
|
|
|
@ -1,44 +0,0 @@
|
||||||
// ignore_for_file: prefer_const_constructors
|
|
||||||
|
|
||||||
import 'package:lightmeter/screens/metering/communication/event_communication_metering.dart';
|
|
||||||
import 'package:test/test.dart';
|
|
||||||
|
|
||||||
void main() {
|
|
||||||
group(
|
|
||||||
'`MeteringInProgressEvent`',
|
|
||||||
() {
|
|
||||||
final a = MeteringInProgressEvent(1.0);
|
|
||||||
final b = MeteringInProgressEvent(1.0);
|
|
||||||
final c = MeteringInProgressEvent(2.0);
|
|
||||||
test('==', () {
|
|
||||||
expect(a == b && b == a, true);
|
|
||||||
expect(a != c && c != a, true);
|
|
||||||
expect(b != c && c != b, true);
|
|
||||||
});
|
|
||||||
test('hashCode', () {
|
|
||||||
expect(a.hashCode == b.hashCode, true);
|
|
||||||
expect(a.hashCode != c.hashCode, true);
|
|
||||||
expect(b.hashCode != c.hashCode, true);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
group(
|
|
||||||
'`MeteringEndedEvent`',
|
|
||||||
() {
|
|
||||||
final a = MeteringEndedEvent(1.0);
|
|
||||||
final b = MeteringEndedEvent(1.0);
|
|
||||||
final c = MeteringEndedEvent(2.0);
|
|
||||||
test('==', () {
|
|
||||||
expect(a == b && b == a, true);
|
|
||||||
expect(a != c && c != a, true);
|
|
||||||
expect(b != c && c != b, true);
|
|
||||||
});
|
|
||||||
test('hashCode', () {
|
|
||||||
expect(a.hashCode == b.hashCode, true);
|
|
||||||
expect(a.hashCode != c.hashCode, true);
|
|
||||||
expect(b.hashCode != c.hashCode, true);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
|
@ -1,44 +0,0 @@
|
||||||
// ignore_for_file: prefer_const_constructors
|
|
||||||
|
|
||||||
import 'package:lightmeter/screens/metering/communication/state_communication_metering.dart';
|
|
||||||
import 'package:test/test.dart';
|
|
||||||
|
|
||||||
void main() {
|
|
||||||
group(
|
|
||||||
'`MeteringInProgressState`',
|
|
||||||
() {
|
|
||||||
final a = MeteringInProgressState(1.0);
|
|
||||||
final b = MeteringInProgressState(1.0);
|
|
||||||
final c = MeteringInProgressState(2.0);
|
|
||||||
test('==', () {
|
|
||||||
expect(a == b && b == a, true);
|
|
||||||
expect(a != c && c != a, true);
|
|
||||||
expect(b != c && c != b, true);
|
|
||||||
});
|
|
||||||
test('hashCode', () {
|
|
||||||
expect(a.hashCode == b.hashCode, true);
|
|
||||||
expect(a.hashCode != c.hashCode, true);
|
|
||||||
expect(b.hashCode != c.hashCode, true);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
group(
|
|
||||||
'`MeteringEndedState`',
|
|
||||||
() {
|
|
||||||
final a = MeteringEndedState(1.0);
|
|
||||||
final b = MeteringEndedState(1.0);
|
|
||||||
final c = MeteringEndedState(2.0);
|
|
||||||
test('==', () {
|
|
||||||
expect(a == b && b == a, true);
|
|
||||||
expect(a != c && c != a, true);
|
|
||||||
expect(b != c && c != b, true);
|
|
||||||
});
|
|
||||||
test('hashCode', () {
|
|
||||||
expect(a.hashCode == b.hashCode, true);
|
|
||||||
expect(a.hashCode != c.hashCode, true);
|
|
||||||
expect(b.hashCode != c.hashCode, true);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
Loading…
Reference in a new issue