54 lines
1.7 KiB
Dart
54 lines
1.7 KiB
Dart
// Copyright (C) 2023 WYATT GROUP
|
|
// Please see the AUTHORS file for details.
|
|
//
|
|
// This program is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// any later version.
|
|
//
|
|
// This program is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU General Public License
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
import 'package:brick_generator/string_extension.dart';
|
|
import 'package:test/test.dart';
|
|
|
|
void main() {
|
|
final expected = {
|
|
'camel_case': 'featureName',
|
|
'constant_case': 'FEATURE_NAME',
|
|
'dot_case': 'feature.name',
|
|
'header_case': 'Feature-Name',
|
|
'lower_case': 'feature name',
|
|
'pascal_case': 'FeatureName',
|
|
'param_case': 'feature-name',
|
|
'sentence_case': 'Feature name',
|
|
'title_case': 'Feature Name',
|
|
'upper_case': 'FEATURE NAME',
|
|
'snake_case': 'feature_name',
|
|
};
|
|
test('transforms `feature_name`', () {
|
|
final name = 'feature_name';
|
|
expect(name.syntaxes, equals(expected));
|
|
});
|
|
|
|
test('transforms `featureName`', () {
|
|
final name = 'feature_name';
|
|
expect(name.syntaxes, equals(expected));
|
|
});
|
|
|
|
test('transforms `feature-Name`', () {
|
|
final name = 'feature_name';
|
|
expect(name.syntaxes, equals(expected));
|
|
});
|
|
|
|
test('transforms `Feature Name`', () {
|
|
final name = 'feature_name';
|
|
expect(name.syntaxes, equals(expected));
|
|
});
|
|
}
|