@@ -98,19 +98,19 @@ void main() {
98
98
99
99
test ('path must be non-empty strings' , () {
100
100
DocumentReference docRef = firestore.doc ('foo/bar' );
101
- expect (() => firestore.collection ('' ), throwsAssertionError );
102
- expect (() => docRef.collection ('' ), throwsAssertionError );
101
+ expect (() => firestore.collection ('' ), throwsArgumentError );
102
+ expect (() => docRef.collection ('' ), throwsArgumentError );
103
103
});
104
104
105
105
test ('path must be odd length' , () {
106
106
DocumentReference docRef = firestore.doc ('foo/bar' );
107
- expect (() => firestore.collection ('foo/bar' ), throwsAssertionError );
107
+ expect (() => firestore.collection ('foo/bar' ), throwsArgumentError );
108
108
expect (
109
109
() => firestore.collection ('foo/bar/baz/quu' ),
110
- throwsAssertionError ,
110
+ throwsArgumentError ,
111
111
);
112
- expect (() => docRef.collection ('foo/bar' ), throwsAssertionError );
113
- expect (() => docRef.collection ('foo/bar/baz/quu' ), throwsAssertionError );
112
+ expect (() => docRef.collection ('foo/bar' ), throwsArgumentError );
113
+ expect (() => docRef.collection ('foo/bar/baz/quu' ), throwsArgumentError );
114
114
});
115
115
116
116
test ('must not have empty segments' , () {
@@ -124,31 +124,31 @@ void main() {
124
124
DocumentReference docRef = colRef.doc ('test-document' );
125
125
126
126
for (final path in badPaths) {
127
- expect (() => firestore.collection (path), throwsAssertionError );
128
- expect (() => firestore.doc (path), throwsAssertionError );
129
- expect (() => colRef.doc (path), throwsAssertionError );
130
- expect (() => docRef.collection (path), throwsAssertionError );
127
+ expect (() => firestore.collection (path), throwsArgumentError );
128
+ expect (() => firestore.doc (path), throwsArgumentError );
129
+ expect (() => colRef.doc (path), throwsArgumentError );
130
+ expect (() => docRef.collection (path), throwsArgumentError );
131
131
}
132
132
});
133
133
134
134
group ('validate' , () {
135
135
test ('path must be non-empty strings' , () {
136
136
DocumentReference docRef = firestore.doc ('foo/bar' );
137
- expect (() => firestore.collection ('' ), throwsAssertionError );
138
- expect (() => docRef.collection ('' ), throwsAssertionError );
137
+ expect (() => firestore.collection ('' ), throwsArgumentError );
138
+ expect (() => docRef.collection ('' ), throwsArgumentError );
139
139
});
140
140
141
141
test ('path must be odd length' , () {
142
142
DocumentReference docRef = firestore.doc ('foo/bar' );
143
- expect (() => firestore.collection ('foo/bar' ), throwsAssertionError );
143
+ expect (() => firestore.collection ('foo/bar' ), throwsArgumentError );
144
144
expect (
145
145
() => firestore.collection ('foo/bar/baz/quu' ),
146
- throwsAssertionError ,
146
+ throwsArgumentError ,
147
147
);
148
- expect (() => docRef.collection ('foo/bar' ), throwsAssertionError );
148
+ expect (() => docRef.collection ('foo/bar' ), throwsArgumentError );
149
149
expect (
150
150
() => docRef.collection ('foo/bar/baz/quu' ),
151
- throwsAssertionError ,
151
+ throwsArgumentError ,
152
152
);
153
153
});
154
154
@@ -163,10 +163,10 @@ void main() {
163
163
DocumentReference docRef = colRef.doc ('test-document' );
164
164
165
165
for (final String path in badPaths) {
166
- expect (() => firestore.collection (path), throwsAssertionError );
167
- expect (() => firestore.doc (path), throwsAssertionError );
168
- expect (() => colRef.doc (path), throwsAssertionError );
169
- expect (() => docRef.collection (path), throwsAssertionError );
166
+ expect (() => firestore.collection (path), throwsArgumentError );
167
+ expect (() => firestore.doc (path), throwsArgumentError );
168
+ expect (() => colRef.doc (path), throwsArgumentError );
169
+ expect (() => docRef.collection (path), throwsArgumentError );
170
170
}
171
171
});
172
172
});
0 commit comments