You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

26 lines
823 B

import 'package:eaimar/data/models/device_category.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
test('Echo-translation 与 Echo-one 都归到耳机品类', () {
expect(
DeviceCategories.categoryIdForName('Echo-translation'),
DeviceCategories.earphone,
);
expect(
DeviceCategories.categoryIdForName('Echo-one'),
DeviceCategories.earphone,
);
expect(
DeviceCategories.categoryIdForName('ECHO-TRANSLATION-3F2A'),
DeviceCategories.earphone,
);
});
test('两个产品名互不包含,不会把 Echo-one 认成 Echo-translation', () {
const echoOne = 'echo-one';
const echoTranslation = 'echo-translation';
expect(echoTranslation.contains(echoOne), isFalse);
expect(echoOne.contains(echoTranslation), isFalse);
});
}