Skip to content

Commit 15b6ef8

Browse files
committed
#124: added extra tests
1 parent c4aa333 commit 15b6ef8

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

test/writer/model_reader_test.dart

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,51 @@ TestModel:
110110
expect(requiredString2.isRequired, true);
111111
});
112112

113+
test('Test List not supported anymore', () {
114+
dynamic error;
115+
try {
116+
final config = YmlGeneratorConfig(
117+
PubspecConfig("name: test"),
118+
"""
119+
TestModel:
120+
properties:
121+
list:
122+
type: array
123+
items:
124+
type: String
125+
""",
126+
'');
127+
128+
config.checkIfTypesAvailable();
129+
} catch (e) {
130+
error = e;
131+
}
132+
expect(error, isNotNull);
133+
});
134+
135+
test('Test Map not supported anymore', () {
136+
dynamic error;
137+
try {
138+
final config = YmlGeneratorConfig(
139+
PubspecConfig("name: test"),
140+
"""
141+
TestModel:
142+
properties:
143+
list:
144+
type: map
145+
items:
146+
key: String
147+
value: String
148+
""",
149+
'');
150+
151+
config.checkIfTypesAvailable();
152+
} catch (e) {
153+
error = e;
154+
}
155+
expect(error, isNotNull);
156+
});
157+
113158
test('Test simple generic fields', () {
114159
final models = YmlGeneratorConfig(
115160
PubspecConfig("name: test"),

0 commit comments

Comments
 (0)