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 18, 2023
1 parent fecab65 commit e85e136
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Sources/MongoDBModel/MongoDatabase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ internal extension MongoDatabase {
}
}

fileprivate extension MongoDatabase {
private extension MongoDatabase {

func collection(
_ name: EntityName,
Expand Down
11 changes: 6 additions & 5 deletions Tests/CoreModelMongoDBTests/MongoDBModelTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,17 @@ final class MongoDBModelTests: XCTestCase {
name: "John Appleseed",
age: 22
)

try await store.insert(person1)


var event1 = Event(
name: "WWDC",
date: Date(timeIntervalSinceNow: 60 * 60 * 24 * 10),
people: [person1.id]
date: Date(timeIntervalSinceNow: 60 * 60 * 24 * 10)
)

event1.people.append(person1.id)
person1.events.append(event1.id)

try await store.insert(event1)
try await store.insert(person1)
person1 = try await store.fetch(Person.self, for: person1.id)!
XCTAssertEqual(person1.events, [event1.id])
event1 = try await store.fetch(Event.self, for: event1.id)!
Expand Down

0 comments on commit e85e136

Please sign in to comment.