mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-24 00:10:47 +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;
|
||||
const iso100 = IsoValue(100, StopType.full);
|
||||
|
||||
setUp(() {
|
||||
setUpAll(() {
|
||||
meteringInteractor = _MockMeteringInteractor();
|
||||
communicationBloc = _MockMeteringCommunicationBloc();
|
||||
|
||||
when<IsoValue>(() => meteringInteractor.iso).thenReturn(iso100);
|
||||
when<NdValue>(() => meteringInteractor.ndFilter).thenReturn(NdValue.values.first);
|
||||
when<Film>(() => meteringInteractor.film).thenReturn(Film.values.first);
|
||||
|
||||
when(meteringInteractor.quickVibration).thenAnswer((_) async {});
|
||||
when(meteringInteractor.responseVibration).thenAnswer((_) async {});
|
||||
when(meteringInteractor.errorVibration).thenAnswer((_) async {});
|
||||
});
|
||||
|
||||
communicationBloc = _MockMeteringCommunicationBloc();
|
||||
|
||||
setUp(() {
|
||||
bloc = MeteringBloc(
|
||||
meteringInteractor,
|
||||
communicationBloc,
|
||||
|
@ -44,7 +47,6 @@ void main() {
|
|||
|
||||
tearDown(() {
|
||||
bloc.close();
|
||||
communicationBloc.close();
|
||||
});
|
||||
|
||||
group(
|
||||
|
@ -469,7 +471,6 @@ void main() {
|
|||
verify: (_) {
|
||||
verify(() => meteringInteractor.film = const Film.other()).called(1);
|
||||
verifyNever(() => meteringInteractor.iso = const IsoValue(0, StopType.full));
|
||||
verifyNever(() => meteringInteractor.responseVibration());
|
||||
},
|
||||
expect: () => [
|
||||
isA<MeteringDataState>()
|
||||
|
|
|
@ -46,7 +46,6 @@ void main() {
|
|||
bloc.add(const MeteringInProgressEvent(2));
|
||||
bloc.add(const MeasureEvent());
|
||||
bloc.add(const MeteringEndedEvent(2));
|
||||
bloc.add(const MeteringEndedEvent(2));
|
||||
},
|
||||
expect: () => [
|
||||
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