Skip to content

Commit 86720f5

Browse files
committed
Add a test for attributeValueClassName
CoreData itself sets this to the Foundation type. Which then later fails on loads?
1 parent a971db3 commit 86720f5

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Tests/ManagedModelTests/CoreDataAssumptionsTests.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,20 @@ final class CoreDataAssumptionsTests: XCTestCase {
6767
XCTAssertEqual(relationship.isOrdered, copiedRelationship.isOrdered)
6868
XCTAssertEqual(relationship.maxCount, copiedRelationship.maxCount)
6969
}
70+
71+
72+
func testAttributeValueClassIsNotEmpty() throws {
73+
do {
74+
let attribute = NSAttributeDescription()
75+
attribute.name = "Hello"
76+
attribute.attributeType = .stringAttributeType
77+
XCTAssertEqual(attribute.attributeValueClassName, "NSString")
78+
}
79+
do {
80+
let attribute = NSAttributeDescription()
81+
attribute.name = "Hello"
82+
attribute.attributeType = .integer16AttributeType
83+
XCTAssertEqual(attribute.attributeValueClassName, "NSNumber")
84+
}
85+
}
7086
}

0 commit comments

Comments
 (0)