Compare commits

..

No commits in common. "667cfe2b03502acf03e21cb7b2f1a0ece01113ed" and "33274ad1f6f7916537801bf8f859c077f2121601" have entirely different histories.

4 changed files with 1 additions and 120 deletions

View file

@ -62,14 +62,4 @@ class CameraErrorState extends CameraContainerState {
final CameraErrorType error; final CameraErrorType error;
const CameraErrorState(this.error); const CameraErrorState(this.error);
@override
bool operator ==(Object other) {
if (identical(this, other)) return true;
if (other.runtimeType != runtimeType) return false;
return other is CameraErrorState && other.error == error;
}
@override
int get hashCode => Object.hash(error, runtimeType);
} }

View file

@ -1,44 +0,0 @@
// ignore_for_file: prefer_const_constructors
import 'package:lightmeter/screens/metering/components/camera_container/event_container_camera.dart';
import 'package:test/test.dart';
void main() {
group(
'`ZoomChangedEvent`',
() {
final a = ZoomChangedEvent(1.0);
final b = ZoomChangedEvent(1.0);
final c = ZoomChangedEvent(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(
'`ExposureOffsetChangedEvent`',
() {
final a = ExposureOffsetChangedEvent(1.0);
final b = ExposureOffsetChangedEvent(1.0);
final c = ExposureOffsetChangedEvent(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);
});
},
);
}

View file

@ -1,64 +0,0 @@
// ignore_for_file: prefer_const_constructors
import 'package:flutter/material.dart';
import 'package:lightmeter/screens/metering/components/camera_container/models/camera_error_type.dart';
import 'package:lightmeter/screens/metering/components/camera_container/state_container_camera.dart';
import 'package:test/test.dart';
void main() {
group(
'`CameraActiveState`',
() {
final a = CameraActiveState(
zoomRange: RangeValues(1, 7),
currentZoom: 1,
exposureOffsetRange: RangeValues(-4, 4),
currentExposureOffset: 0,
exposureOffsetStep: 0.167,
);
final b = CameraActiveState(
zoomRange: RangeValues(1, 7),
currentZoom: 1,
exposureOffsetRange: RangeValues(-4, 4),
currentExposureOffset: 0,
exposureOffsetStep: 0.167,
);
final c = CameraActiveState(
zoomRange: RangeValues(1, 4),
currentZoom: 3,
exposureOffsetRange: RangeValues(-2, 2),
currentExposureOffset: 0,
exposureOffsetStep: 0.167,
);
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(
'`CameraErrorState`',
() {
final a = CameraErrorState(CameraErrorType.noCamerasDetected);
final b = CameraErrorState(CameraErrorType.noCamerasDetected);
final c = CameraErrorState(CameraErrorType.other);
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);
});
},
);
}

View file

@ -1,4 +1,3 @@
flutter test --coverage flutter test --coverage
lcov --remove coverage/lcov.info 'lib/generated/*' 'lib/l10n/*' -o coverage/new_lcov.info genhtml coverage/lcov.info -o coverage/html
genhtml coverage/new_lcov.info -o coverage/html
open coverage/html/index.html open coverage/html/index.html