Skip to content

Commit

Permalink
Updated unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
colemancda committed Aug 21, 2023
1 parent e46f139 commit fbbce91
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Tests/CoreModelMongoDBTests/MongoDBModelTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,11 @@ final class MongoDBModelTests: XCTestCase {
XCTAssertEqual(campgroundData.relationships[PropertyKey(Campground.CodingKeys.units)], .toMany([ObjectID(rentalUnit.id)]))
let fetchedRentalUnit = try await store.fetch(Campground.RentalUnit.self, for: rentalUnit.id)
XCTAssertEqual(fetchedRentalUnit, rentalUnit)
let rentalUnitFetchRequest = FetchRequest(
entity: Campground.RentalUnit.entityName,
predicate: Campground.RentalUnit.CodingKeys.campground.stringValue.compare(.equalTo, .relationship(.toOne(ObjectID(campground.id))))
)
let rentalUnitIDs = try await store.fetchID(rentalUnitFetchRequest)
XCTAssertEqual(rentalUnitIDs, campground.units.map { ObjectID($0) })
}
}

0 comments on commit fbbce91

Please sign in to comment.