Skip to content

Commit ce59a31

Browse files
committed
sketch corresponding CRUD test
1 parent 42cf78c commit ce59a31

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

Tests/MongoSwiftTests/CrudTests.swift

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import XCTest
55

66
// Files to skip because we don't currently support the operations they test.
77
private var skippedFiles = [
8+
// TODO SWIFT-147: enable this
89
"bulkWrite-arrayFilters",
10+
// TODO SWIFT-156: enable these
911
"findOneAndDelete-collation",
1012
"findOneAndDelete",
1113
"findOneAndReplace-collation",
@@ -132,11 +134,15 @@ private func makeCrudTest(_ doc: Document) throws -> CrudTest {
132134
// Maps operation names to the appropriate test class to use for them.
133135
private var testTypeMap: [String: CrudTest.Type] = [
134136
"aggregate": AggregateTest.self,
137+
"bulkWrite": BulkWriteTest.self,
135138
"count": CountTest.self,
136139
"deleteMany": DeleteTest.self,
137140
"deleteOne": DeleteTest.self,
138141
"distinct": DistinctTest.self,
139142
"find": FindTest.self,
143+
"findOneAndDelete": FindOneAndDeleteTest.self,
144+
"findOneAndUpdate": FindOneAndUpdateTest.self,
145+
"findOneAndReplace": FindOneAndReplaceTest.self,
140146
"insertMany": InsertManyTest.self,
141147
"insertOne": InsertOneTest.self,
142148
"replaceOne": ReplaceOneTest.self,
@@ -220,6 +226,12 @@ private class AggregateTest: CrudTest {
220226
}
221227
}
222228

229+
private class BulkWriteTest: CrudTest {
230+
override func execute(usingCollection coll: MongoCollection<Document>) throws {
231+
XCTFail("Unimplemented")
232+
}
233+
}
234+
223235
/// A class for executing `count` tests
224236
private class CountTest: CrudTest {
225237
override func execute(usingCollection coll: MongoCollection<Document>) throws {
@@ -271,6 +283,27 @@ private class FindTest: CrudTest {
271283
}
272284
}
273285

286+
/// A class for executing `findOneAndDelete` tests
287+
private class FindOneAndDeleteTest: CrudTest {
288+
override func execute(usingCollection coll: MongoCollection<Document>) throws {
289+
XCTFail("Unimplemented")
290+
}
291+
}
292+
293+
/// A class for executing `findOneAndUpdate` tests
294+
private class FindOneAndReplaceTest: CrudTest {
295+
override func execute(usingCollection coll: MongoCollection<Document>) throws {
296+
XCTFail("Unimplemented")
297+
}
298+
}
299+
300+
/// A class for executing `findOneAndReplace` tests
301+
private class FindOneAndUpdateTest: CrudTest {
302+
override func execute(usingCollection coll: MongoCollection<Document>) throws {
303+
XCTFail("Unimplemented")
304+
}
305+
}
306+
274307
/// A class for executing `insertMany` tests
275308
private class InsertManyTest: CrudTest {
276309
override func execute(usingCollection coll: MongoCollection<Document>) throws {

0 commit comments

Comments
 (0)