@@ -39,7 +39,7 @@ final class CrudTests: MongoSwiftTestCase {
3939
4040 // for each test case:
4141 // 1) create a unique collection to use
42- // 2) insert the data specified by this test file
42+ // 2) insert the data specified by this test file
4343 // 3) execute the test according to the type's execute method
4444 // 4) verify that expected data is present
4545 // 5) drop the collection to clean up
@@ -82,7 +82,7 @@ final class CrudTests: MongoSwiftTestCase {
8282 }
8383}
8484
85- /// A container for the data from a single .json file.
85+ /// A container for the data from a single .json file.
8686private struct CrudTestFile : Decodable {
8787 let data : [ Document ]
8888 let testDocs : [ Document ]
@@ -95,7 +95,7 @@ private struct CrudTestFile: Decodable {
9595 }
9696}
9797
98- /// Initializes a new `CrudTest` of the appropriate subclass from a `Document`
98+ /// Initializes a new `CrudTest` of the appropriate subclass from a `Document`
9999private func makeCrudTest( _ doc: Document ) throws -> CrudTest {
100100 let operation : Document = try doc. get ( " operation " )
101101 let opName : String = try operation. get ( " name " )
@@ -105,7 +105,7 @@ private func makeCrudTest(_ doc: Document) throws -> CrudTest {
105105 return try type. init ( doc)
106106}
107107
108- // Maps operation names to the appropriate test class to use for them.
108+ // Maps operation names to the appropriate test class to use for them.
109109private var testTypeMap : [ String : CrudTest . Type ] = [
110110 " aggregate " : AggregateTest . self,
111111 " bulkWrite " : BulkWriteTest . self,
@@ -125,7 +125,7 @@ private var testTypeMap: [String: CrudTest.Type] = [
125125]
126126
127127/// An abstract class to represent a single test within a CrudTestFile. Subclasses must
128- /// implement the `execute` method themselves.
128+ /// implement the `execute` method themselves.
129129private class CrudTest {
130130 let description : String
131131 let operationName : String
@@ -164,7 +164,7 @@ private class CrudTest {
164164 }
165165 var upsert : Bool ? { return self . args [ " upsert " ] as? Bool }
166166
167- /// Initializes a new `CrudTest` from a `Document`.
167+ /// Initializes a new `CrudTest` from a `Document`.
168168 required init ( _ test: Document ) throws {
169169 self . description = try test. get ( " description " )
170170 let operation : Document = try test. get ( " operation " )
@@ -176,11 +176,11 @@ private class CrudTest {
176176 self . collection = outcome [ " collection " ] as? Document
177177 }
178178
179- // Subclasses should implement `execute` according to the particular operation(s) they are for.
179+ // Subclasses should implement `execute` according to the particular operation(s) they are for.
180180 func execute( usingCollection coll: MongoCollection < Document > ) throws { XCTFail ( " Unimplemented " ) }
181181
182182 // If the test has a `collection` field in its `outcome`, verify that the expected
183- // data is present. If there is no `collection` field, do nothing.
183+ // data is present. If there is no `collection` field, do nothing.
184184 func verifyData( testCollection coll: MongoCollection < Document > , db: MongoDatabase ) throws {
185185 // only some tests have data to verify
186186 guard let collection = self . collection else {
@@ -194,9 +194,9 @@ private class CrudTest {
194194 expect ( Array ( try collToCheck. find ( [ : ] ) ) ) . to ( equal ( try collection. get ( " data " ) ) )
195195 }
196196
197- // Given an `UpdateResult`, verify that it matches the expected results in this `CrudTest`.
198- // Meant for use by subclasses whose operations return `UpdateResult`s, such as `UpdateTest`
199- // and `ReplaceOneTest`.
197+ // Given an `UpdateResult`, verify that it matches the expected results in this `CrudTest`.
198+ // Meant for use by subclasses whose operations return `UpdateResult`s, such as `UpdateTest`
199+ // and `ReplaceOneTest`.
200200 func verifyUpdateResult( _ result: UpdateResult ? ) throws {
201201 let expected = try BSONDecoder ( ) . decode ( UpdateResult . self, from: self . result as! Document )
202202 expect ( result? . matchedCount) . to ( equal ( expected. matchedCount) )
@@ -211,7 +211,7 @@ private class CrudTest {
211211 }
212212
213213 /// Given the response to a findAndModify command, verify that it matches the expected
214- /// results for this `CrudTest`. Meant for use by findAndModify subclasses, i.e. findOneAndX.
214+ /// results for this `CrudTest`. Meant for use by findAndModify subclasses, i.e. findOneAndX.
215215 func verifyFindAndModifyResult( _ result: Document ? ) {
216216 guard self . result != nil else {
217217 return
@@ -232,13 +232,13 @@ private class AggregateTest: CrudTest {
232232 let options = AggregateOptions ( batchSize: self . batchSize, collation: self . collation)
233233 let cursor = try coll. aggregate ( pipeline, options: options)
234234 if self . collection != nil {
235- // this is $out case - we need to iterate the cursor once in
235+ // this is $out case - we need to iterate the cursor once in
236236 // order to make the aggregation happen. there is nothing in
237237 // the cursor to verify, but verifyData() will check that the
238238 // $out collection has the new data.
239239 expect ( cursor. next ( ) ) . to ( beNil ( ) )
240240 } else {
241- // if not $out, verify that the cursor contains the expected documents.
241+ // if not $out, verify that the cursor contains the expected documents.
242242 expect ( Array ( cursor) ) . to ( equal ( self . result as? [ Document ] ) )
243243 }
244244 }
0 commit comments