 import CoreData
 @testable import CoreDataPlus
 
-class TransformerTests: CoreDataPlusOnDiskTestCase {
+final class TransformerTests: CoreDataPlusOnDiskTestCase {
   @objc(Dummy)
   class Dummy: NSObject, NSSecureCoding {
     static var supportsSecureCoding: Bool { true }
     let name: String
-
+    
     init(name: String) {
       self.name = name
     }
-
+    
     func encode(with coder: NSCoder) {
       coder.encode(name, forKey: "name")
     }
-
+    
     required init?(coder decoder: NSCoder) {
       guard let name = decoder.decodeObject(of: [NSString.self], forKey: "name") as? String else { return nil }
       self.name = name
     }
   }
-
+  
   func testSaveAndFetchTransformableValue() throws {
     let context = container.viewContext
     let car = Car(context: context)

    array.add([Dummy(name: "dummy2"), Dummy(name: "dummy2")])
    let data = transformer.transformedValue(NSArray(array: array))
    XCTAssertNotNil(data)

    let expectedTransformedValue = transformer.reverseTransformedValue(data)
    let expectedNSArray = try XCTUnwrap(expectedTransformedValue as? NSArray)
    let first = try XCTUnwrap(expectedNSArray.object(at: 0) as? Int)

    Transformer<Dummy>.unregister()
    XCTAssertFalse(Foundation.ValueTransformer.valueTransformerNames().contains(DataTransformer<Dummy>.transformerName))
  }
  
  func testTransformer() throws {
    let transformer = Transformer<Color>()
    let data = transformer.reverseTransformedValue(Color(name: "green"))
