2023-06-21 09:29:36 +00:00
|
|
|
import 'package:lightmeter/data/models/metering_screen_layout_config.dart';
|
|
|
|
import 'package:test/test.dart';
|
|
|
|
|
|
|
|
void main() {
|
2023-07-13 21:47:21 +00:00
|
|
|
group(
|
|
|
|
'fromJson()',
|
|
|
|
() {
|
|
|
|
test('All keys', () {
|
|
|
|
expect(
|
|
|
|
MeteringScreenLayoutConfigJson.fromJson(
|
|
|
|
{
|
|
|
|
'0': true,
|
|
|
|
'1': true,
|
|
|
|
'2': true,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
{
|
|
|
|
MeteringScreenLayoutFeature.extremeExposurePairs: true,
|
|
|
|
MeteringScreenLayoutFeature.filmPicker: true,
|
|
|
|
MeteringScreenLayoutFeature.equipmentProfiles: true,
|
|
|
|
},
|
|
|
|
);
|
|
|
|
});
|
2023-06-21 09:29:36 +00:00
|
|
|
|
2023-07-13 21:47:21 +00:00
|
|
|
test('Legacy (no equipment profiles)', () {
|
|
|
|
expect(
|
|
|
|
MeteringScreenLayoutConfigJson.fromJson(
|
|
|
|
{
|
|
|
|
'0': true,
|
|
|
|
'1': true,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
{
|
|
|
|
MeteringScreenLayoutFeature.extremeExposurePairs: true,
|
|
|
|
MeteringScreenLayoutFeature.filmPicker: true,
|
|
|
|
MeteringScreenLayoutFeature.equipmentProfiles: true,
|
|
|
|
},
|
|
|
|
);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
);
|
|
|
|
|
|
|
|
test('toJson()', () {
|
2023-06-21 09:29:36 +00:00
|
|
|
expect(
|
|
|
|
{
|
2023-07-13 21:47:21 +00:00
|
|
|
MeteringScreenLayoutFeature.equipmentProfiles: true,
|
2023-06-21 09:29:36 +00:00
|
|
|
MeteringScreenLayoutFeature.extremeExposurePairs: true,
|
|
|
|
MeteringScreenLayoutFeature.filmPicker: true,
|
|
|
|
}.toJson(),
|
2023-07-13 21:47:21 +00:00
|
|
|
{
|
|
|
|
'2': true,
|
|
|
|
'0': true,
|
|
|
|
'1': true,
|
|
|
|
},
|
2023-06-21 09:29:36 +00:00
|
|
|
);
|
|
|
|
});
|
|
|
|
}
|