Changed API of comparison/sort/enumeration/qos options to match Darwin version (#356)

* Changed API of NSComparisonResult, NSQualityOfService, NSSortOptions and NSEnumerationOptions to match Darwin version

* Removed escaping of case default
diff --git a/Foundation/NSArray.swift b/Foundation/NSArray.swift
index ef9f5c1..0cf69de 100644
--- a/Foundation/NSArray.swift
+++ b/Foundation/NSArray.swift
@@ -406,7 +406,7 @@
         self.enumerateObjectsAtIndexes(NSIndexSet(indexesInRange: NSMakeRange(0, count)), options: opts, usingBlock: block)
     }
     public func enumerateObjectsAtIndexes(_ s: NSIndexSet, options opts: NSEnumerationOptions, usingBlock block: (AnyObject, Int, UnsafeMutablePointer<ObjCBool>) -> Void) {
-        guard !opts.contains(.Concurrent) else {
+        guard !opts.contains(.concurrent) else {
             NSUnimplemented()
         }
         
@@ -461,7 +461,7 @@
 
         let swiftRange = range.toRange()!
         return allObjects[swiftRange].sorted { lhs, rhs in
-            return cmptr(lhs, rhs) == .OrderedAscending
+            return cmptr(lhs, rhs) == .orderedAscending
         }
     }
     
@@ -494,12 +494,12 @@
         }
         
         let leastObj = objectAtIndex(r.location)
-        if cmp(obj, leastObj) == .OrderedAscending {
+        if cmp(obj, leastObj) == .orderedAscending {
             return searchForInsertionIndex ? r.location : NSNotFound
         }
         
         let greatestObj = objectAtIndex(lastIndex)
-        if cmp(obj, greatestObj) == .OrderedDescending {
+        if cmp(obj, greatestObj) == .orderedDescending {
             return searchForInsertionIndex ? lastIndex + 1 : NSNotFound
         }
         
@@ -519,22 +519,22 @@
             
             switch cmp(item, obj) {
                 
-            case .OrderedSame where anyEqual:
+            case .orderedSame where anyEqual:
                 result = middle
                 break loop
                 
-            case .OrderedSame where lastEqual:
+            case .orderedSame where lastEqual:
                 result = middle
                 fallthrough
                 
-            case .OrderedAscending:
+            case .orderedAscending:
                 start = middle + 1
                 
-            case .OrderedSame where firstEqual:
+            case .orderedSame where firstEqual:
                 result = middle
                 fallthrough
                 
-            case .OrderedDescending:
+            case .orderedDescending:
                 indexOfLeastGreaterThanObj = middle
                 end = middle - 1
                 
@@ -793,7 +793,7 @@
     }
     
     public func removeObjectsAtIndexes(_ indexes: NSIndexSet) {
-        indexes.enumerateRangesWithOptions(.Reverse) { (range, _) in
+        indexes.enumerateRangesWithOptions(.reverse) { (range, _) in
             self.removeObjectsInRange(range)
         }
     }
diff --git a/Foundation/NSCalendar.swift b/Foundation/NSCalendar.swift
index 3ef5cd5..0d18213 100644
--- a/Foundation/NSCalendar.swift
+++ b/Foundation/NSCalendar.swift
@@ -684,9 +684,9 @@
     public func compare(_ date1: NSDate, to date2: NSDate, toUnitGranularity unit: NSCalendarUnit) -> NSComparisonResult {
         switch (unit) {
             case NSCalendarUnit.calendar:
-                return .OrderedSame
+                return .orderedSame
             case NSCalendarUnit.timeZone:
-                return .OrderedSame
+                return .orderedSame
             case NSCalendarUnit.day:
                 fallthrough
             case NSCalendarUnit.hour:
@@ -694,12 +694,12 @@
                 let ats = range!.start.timeIntervalSinceReferenceDate
                 let at2 = date2.timeIntervalSinceReferenceDate
                 if ats <= at2 && at2 < ats + range!.interval {
-                    return .OrderedSame
+                    return .orderedSame
                 }
                 if at2 < ats {
-                    return .OrderedDescending
+                    return .orderedDescending
                 }
-                return .OrderedAscending
+                return .orderedAscending
             case NSCalendarUnit.minute:
                 var int1 = 0.0
                 var int2 = 0.0
@@ -708,24 +708,24 @@
                 int1 = floor(int1 / 60.0)
                 int2 = floor(int2 / 60.0)
                 if int1 == int2 {
-                    return .OrderedSame
+                    return .orderedSame
                 }
                 if int2 < int1 {
-                    return .OrderedDescending
+                    return .orderedDescending
                 }
-                return .OrderedAscending
+                return .orderedAscending
             case NSCalendarUnit.second:
                 var int1 = 0.0
                 var int2 = 0.0
                 modf(date1.timeIntervalSinceReferenceDate, &int1)
                 modf(date2.timeIntervalSinceReferenceDate, &int2)
                 if int1 == int2 {
-                    return .OrderedSame
+                    return .orderedSame
                 }
                 if int2 < int1 {
-                    return .OrderedDescending
+                    return .orderedDescending
                 }
-                return .OrderedAscending
+                return .orderedAscending
             case NSCalendarUnit.nanosecond:
                 var int1 = 0.0
                 var int2 = 0.0
@@ -734,12 +734,12 @@
                 int1 = floor(frac1 * 1000000000.0)
                 int2 = floor(frac2 * 1000000000.0)
                 if int1 == int2 {
-                    return .OrderedSame
+                    return .orderedSame
                 }
                 if int2 < int1 {
-                    return .OrderedDescending
+                    return .orderedDescending
                 }
-                return .OrderedAscending
+                return .orderedAscending
             default:
                 break
         }
@@ -768,45 +768,45 @@
             let value1 = comp1.value(forComponent: unit)
             let value2 = comp2.value(forComponent: unit)
             if value1 > value2 {
-                return .OrderedDescending
+                return .orderedDescending
             } else if value1 < value2 {
-                return .OrderedAscending
+                return .orderedAscending
             }
             if unit == .month && calendarIdentifier == kCFCalendarIdentifierChinese._swiftObject {
                 let leap1 = comp1.leapMonth
                 let leap2 = comp2.leapMonth
                 if !leap1 && leap2 {
-                    return .OrderedAscending
+                    return .orderedAscending
                 } else if leap1 && !leap2 {
-                    return .OrderedDescending
+                    return .orderedDescending
                 }
             }
             if unit == reducedUnits {
-                return .OrderedSame
+                return .orderedSame
             }
         }
-        return .OrderedSame
+        return .orderedSame
     }
     
     /*
     This API compares the given dates down to the given unit, reporting them equal if they are the same in the given unit and all larger units.
     */
     public func isDate(_ date1: NSDate, equalToDate date2: NSDate, toUnitGranularity unit: NSCalendarUnit) -> Bool {
-        return compare(date1, to: date2, toUnitGranularity: unit) == .OrderedSame
+        return compare(date1, to: date2, toUnitGranularity: unit) == .orderedSame
     }
     
     /*
     This API compares the Days of the given dates, reporting them equal if they are in the same Day.
     */
     public func isDate(_ date1: NSDate, inSameDayAsDate date2: NSDate) -> Bool {
-        return compare(date1, to: date2, toUnitGranularity: .day) == .OrderedSame
+        return compare(date1, to: date2, toUnitGranularity: .day) == .orderedSame
     }
     
     /*
     This API reports if the date is within "today".
     */
     public func isDateInToday(_ date: NSDate) -> Bool {
-        return compare(date, to: NSDate(), toUnitGranularity: .day) == .OrderedSame
+        return compare(date, to: NSDate(), toUnitGranularity: .day) == .orderedSame
     }
     
     /*
@@ -815,7 +815,7 @@
     public func isDateInYesterday(_ date: NSDate) -> Bool {
         if let interval = range(of: .day, forDate: NSDate()) {
             let inYesterday = interval.start.addingTimeInterval(-60.0)
-            return compare(date, to: inYesterday, toUnitGranularity: .day) == .OrderedSame
+            return compare(date, to: inYesterday, toUnitGranularity: .day) == .orderedSame
         } else {
             return false
         }
@@ -827,7 +827,7 @@
     public func isDateInTomorrow(_ date: NSDate) -> Bool {
         if let interval = range(of: .day, forDate: NSDate()) {
             let inTomorrow = interval.end.addingTimeInterval(60.0)
-            return compare(date, to: inTomorrow, toUnitGranularity: .day) == .OrderedSame
+            return compare(date, to: inTomorrow, toUnitGranularity: .day) == .orderedSame
         } else {
             return false
         }
@@ -882,7 +882,7 @@
                 comp.weekday = range.end
                 if let nextEnd = nextDate(after: date, matchingComponents: comp, options: options.union(.matchNextTime)) {
                     var end = nextEnd
-                    if end.compare(start) == .OrderedAscending {
+                    if end.compare(start) == .orderedAscending {
                         if let nextOrderedEnd = nextDate(after: end, matchingComponents: comp, options: options.union(.matchNextTime)) {
                             end = nextOrderedEnd
                         } else {
@@ -1043,7 +1043,7 @@
                 options.formUnion(.matchStrictly)
             }
             if let result = nextDate(after: range.start.addingTimeInterval(-0.5), matchingComponents: comps, options: options) {
-                if result.compare(range.start) == .OrderedAscending {
+                if result.compare(range.start) == .orderedAscending {
                     return nextDate(after: range.start, matchingComponents: comps, options: options)
                 }
                 return result
diff --git a/Foundation/NSDate.swift b/Foundation/NSDate.swift
index 6f43821..e9e7d8a 100644
--- a/Foundation/NSDate.swift
+++ b/Foundation/NSDate.swift
@@ -185,11 +185,11 @@
         let t1 = self.timeIntervalSinceReferenceDate
         let t2 = other.timeIntervalSinceReferenceDate
         if t1 < t2 {
-            return .OrderedAscending
+            return .orderedAscending
         } else if t1 > t2 {
-            return .OrderedDescending
+            return .orderedDescending
         } else {
-            return .OrderedSame
+            return .orderedSame
         }
     }
     
diff --git a/Foundation/NSDictionary.swift b/Foundation/NSDictionary.swift
index 91fbb7c..c880856 100644
--- a/Foundation/NSDictionary.swift
+++ b/Foundation/NSDictionary.swift
@@ -505,7 +505,7 @@
 
     public func keysSortedByValueWithOptions(_ opts: NSSortOptions, usingComparator cmptr: NSComparator) -> [AnyObject] {
         let sorted = allKeys.sorted { lhs, rhs in
-            return cmptr(lhs, rhs) == .OrderedSame
+            return cmptr(lhs, rhs) == .orderedSame
         }
         return sorted
     }
diff --git a/Foundation/NSIndexPath.swift b/Foundation/NSIndexPath.swift
index 1ee5c8c..69076f0 100644
--- a/Foundation/NSIndexPath.swift
+++ b/Foundation/NSIndexPath.swift
@@ -82,16 +82,16 @@
             let otherValue = otherObject.indexAtPosition(pos)
             let thisValue = indexAtPosition(pos)
             if thisValue < otherValue {
-                return .OrderedAscending
+                return .orderedAscending
             } else if thisValue > otherValue {
-                return .OrderedDescending
+                return .orderedDescending
             }
         }
         if thisLength > otherLength {
-            return .OrderedDescending
+            return .orderedDescending
         } else if thisLength < otherLength {
-            return .OrderedAscending
+            return .orderedAscending
         }
-        return .OrderedSame
+        return .orderedSame
     }
 }
diff --git a/Foundation/NSIndexSet.swift b/Foundation/NSIndexSet.swift
index feb43b3..46a9433 100644
--- a/Foundation/NSIndexSet.swift
+++ b/Foundation/NSIndexSet.swift
@@ -342,7 +342,7 @@
     }
     
     internal func _enumerateWithOptions<P, R>(_ opts : NSEnumerationOptions, range: NSRange, paramType: P.Type, returnType: R.Type, block: (P, UnsafeMutablePointer<ObjCBool>) -> R) -> Int? {
-        guard !opts.contains(.Concurrent) else {
+        guard !opts.contains(.concurrent) else {
             NSUnimplemented()
         }
         
@@ -351,7 +351,7 @@
         }
 
         var result : Int? = nil
-        let reverse = opts.contains(.Reverse)
+        let reverse = opts.contains(.reverse)
         let passRanges = paramType == NSRange.self
         let findIndex = returnType == Bool.self
         var stop = false
diff --git a/Foundation/NSObjCRuntime.swift b/Foundation/NSObjCRuntime.swift
index e3660a3..81749c4 100644
--- a/Foundation/NSObjCRuntime.swift
+++ b/Foundation/NSObjCRuntime.swift
@@ -137,17 +137,17 @@
 
 public enum NSComparisonResult : Int {
     
-    case OrderedAscending = -1
-    case OrderedSame
-    case OrderedDescending
+    case orderedAscending = -1
+    case orderedSame
+    case orderedDescending
     
     internal static func _fromCF(_ val: CFComparisonResult) -> NSComparisonResult {
         if val == kCFCompareLessThan {
-            return .OrderedAscending
+            return .orderedAscending
         } else if  val == kCFCompareGreaterThan {
-            return .OrderedDescending
+            return .orderedDescending
         } else {
-            return .OrderedSame
+            return .orderedSame
         }
     }
 }
@@ -156,35 +156,35 @@
 public enum NSQualityOfService : Int {
     
     /* UserInteractive QoS is used for work directly involved in providing an interactive UI such as processing events or drawing to the screen. */
-    case UserInteractive
+    case userInteractive
     
     /* UserInitiated QoS is used for performing work that has been explicitly requested by the user and for which results must be immediately presented in order to allow for further user interaction.  For example, loading an email after a user has selected it in a message list. */
-    case UserInitiated
+    case userInitiated
     
     /* Utility QoS is used for performing work which the user is unlikely to be immediately waiting for the results.  This work may have been requested by the user or initiated automatically, does not prevent the user from further interaction, often operates at user-visible timescales and may have its progress indicated to the user by a non-modal progress indicator.  This work will run in an energy-efficient manner, in deference to higher QoS work when resources are constrained.  For example, periodic content updates or bulk file operations such as media import. */
-    case Utility
+    case utility
     
     /* Background QoS is used for work that is not user initiated or visible.  In general, a user is unaware that this work is even happening and it will run in the most efficient manner while giving the most deference to higher QoS work.  For example, pre-fetching content, search indexing, backups, and syncing of data with external systems. */
-    case Background
+    case background
     
     /* Default QoS indicates the absence of QoS information.  Whenever possible QoS information will be inferred from other sources.  If such inference is not possible, a QoS between UserInitiated and Utility will be used. */
-    case Default
+    case `default`
 }
 
 public struct NSSortOptions : OptionSet {
     public let rawValue : UInt
     public init(rawValue: UInt) { self.rawValue = rawValue }
     
-    public static let Concurrent = NSSortOptions(rawValue: UInt(1 << 0))
-    public static let Stable = NSSortOptions(rawValue: UInt(1 << 4))
+    public static let concurrent = NSSortOptions(rawValue: UInt(1 << 0))
+    public static let stable = NSSortOptions(rawValue: UInt(1 << 4))
 }
 
 public struct NSEnumerationOptions : OptionSet {
     public let rawValue : UInt
     public init(rawValue: UInt) { self.rawValue = rawValue }
     
-    public static let Concurrent = NSEnumerationOptions(rawValue: UInt(1 << 0))
-    public static let Reverse = NSEnumerationOptions(rawValue: UInt(1 << 1))
+    public static let concurrent = NSEnumerationOptions(rawValue: UInt(1 << 0))
+    public static let reverse = NSEnumerationOptions(rawValue: UInt(1 << 1))
 }
 
 public typealias NSComparator = (AnyObject, AnyObject) -> NSComparisonResult
diff --git a/Foundation/NSOperation.swift b/Foundation/NSOperation.swift
index 5a24988..ed151cc 100644
--- a/Foundation/NSOperation.swift
+++ b/Foundation/NSOperation.swift
@@ -141,7 +141,7 @@
     public var threadPriority: Double = 0.5
     
     /// - Note: Quality of service is not directly supported here since there are not qos class promotions available outside of darwin targets.
-    public var qualityOfService: NSQualityOfService = .Default
+    public var qualityOfService: NSQualityOfService = .default
     
     public var name: String?
     
@@ -495,7 +495,7 @@
         }
     }
     
-    public var qualityOfService: NSQualityOfService = .Default
+    public var qualityOfService: NSQualityOfService = .default
 #if DEPLOYMENT_ENABLE_LIBDISPATCH
     // Note: this will return non nil whereas the objective-c version will only return non nil when it has been set.
     // it uses a target queue assignment instead of returning the actual underlying queue.
diff --git a/Foundation/NSOrderedSet.swift b/Foundation/NSOrderedSet.swift
index 0d4a29e..e79df76 100644
--- a/Foundation/NSOrderedSet.swift
+++ b/Foundation/NSOrderedSet.swift
@@ -538,7 +538,7 @@
 
         let swiftRange = range.toRange()!
         _orderedStorage[swiftRange].sort { lhs, rhs in
-            return cmptr(lhs, rhs) == .OrderedAscending
+            return cmptr(lhs, rhs) == .orderedAscending
         }
     }
 }
diff --git a/Foundation/NSString.swift b/Foundation/NSString.swift
index e7f6344..c0a2298 100644
--- a/Foundation/NSString.swift
+++ b/Foundation/NSString.swift
@@ -441,7 +441,7 @@
         if self.dynamicType == NSString.self || self.dynamicType == NSMutableString.self {
             return _storage == aString
         } else {
-            return length == aString.length && compare(aString, options: .literalSearch, range: NSMakeRange(0, length)) == .OrderedSame
+            return length == aString.length && compare(aString, options: .literalSearch, range: NSMakeRange(0, length)) == .orderedSame
         }
     }
     
diff --git a/Foundation/NSTask.swift b/Foundation/NSTask.swift
index 3ee8f4d..3c5422c 100644
--- a/Foundation/NSTask.swift
+++ b/Foundation/NSTask.swift
@@ -390,7 +390,7 @@
     A block to be invoked when the process underlying the NSTask terminates.  Setting the block to nil is valid, and stops the previous block from being invoked, as long as it hasn't started in any way.  The NSTask is passed as the argument to the block so the block does not have to capture, and thus retain, it.  The block is copied when set.  Only one termination handler block can be set at any time.  The execution context in which the block is invoked is undefined.  If the NSTask has already finished, the block is executed immediately/soon (not necessarily on the current thread).  If a terminationHandler is set on an NSTask, the NSTaskDidTerminateNotification notification is not posted for that task.  Also note that -waitUntilExit won't wait until the terminationHandler has been fully executed.  You cannot use this property in a concrete subclass of NSTask which hasn't been updated to include an implementation of the storage and use of it.  
     */
     public var terminationHandler: ((NSTask) -> Void)?
-    public var qualityOfService: NSQualityOfService = .Default  // read-only after the task is launched
+    public var qualityOfService: NSQualityOfService = .default  // read-only after the task is launched
 }
 
 extension NSTask {
diff --git a/TestFoundation/TestNSArray.swift b/TestFoundation/TestNSArray.swift
index 892daa3..227be3a 100644
--- a/TestFoundation/TestNSArray.swift
+++ b/TestFoundation/TestNSArray.swift
@@ -268,13 +268,13 @@
         let lhsInt = (lhs as! NSNumber).intValue
         let rhsInt = (rhs as! NSNumber).intValue
         if lhsInt == rhsInt {
-            return .OrderedSame
+            return .orderedSame
         }
         if lhsInt < rhsInt {
-            return .OrderedAscending
+            return .orderedAscending
         }
         
-        return .OrderedDescending
+        return .orderedDescending
     }
     
     func test_replaceObjectsInRange_withObjectsFromArray() {
@@ -327,7 +327,7 @@
         XCTAssertEqual(result.map { ($0 as! NSString).bridge()} , expectedResult)
 
         // sort empty array
-        let emptyArray = NSArray().sortedArrayUsingComparator { _,_ in .OrderedSame }
+        let emptyArray = NSArray().sortedArrayUsingComparator { _,_ in .orderedSame }
         XCTAssertTrue(emptyArray.isEmpty)
 
         // sort numbers
@@ -336,7 +336,7 @@
         let resultNumbers = inputNumbers.bridge().sortedArrayUsingComparator { left, right -> NSComparisonResult in
             let l = (left as! NSNumber).intValue
             let r = (right as! NSNumber).intValue
-            return l < r ? .OrderedAscending : (l > r ? .OrderedSame : .OrderedDescending)
+            return l < r ? .orderedAscending : (l > r ? .orderedSame : .orderedDescending)
         }
         XCTAssertEqual(resultNumbers.map { ($0 as! NSNumber).intValue}, expectedNumbers)
     }
@@ -355,7 +355,7 @@
         XCTAssertTrue(result1.bridge().isEqualToArray(result2))
 
         // sort empty array
-        let emptyArray = NSArray().sortedArrayWithOptions([]) { _,_ in .OrderedSame }
+        let emptyArray = NSArray().sortedArrayWithOptions([]) { _,_ in .orderedSame }
         XCTAssertTrue(emptyArray.isEmpty)
     }
 
@@ -383,7 +383,7 @@
         mutableInput.sortUsingComparator { left, right -> NSComparisonResult in
             let l = (left as! NSNumber).intValue
             let r = (right as! NSNumber).intValue
-            return l < r ? .OrderedAscending : (l > r ? .OrderedSame : .OrderedDescending)
+            return l < r ? .orderedAscending : (l > r ? .orderedSame : .orderedDescending)
         }
 
         XCTAssertEqual(mutableInput.map { ($0 as! NSNumber).intValue}, expectedNumbers)
diff --git a/TestFoundation/TestNSDate.swift b/TestFoundation/TestNSDate.swift
index 4735bb7..ce04a15 100644
--- a/TestFoundation/TestNSDate.swift
+++ b/TestFoundation/TestNSDate.swift
@@ -104,7 +104,7 @@
         let ti: NSTimeInterval = 1
         let d1 = NSDate()
         let d2 = d1.addingTimeInterval(ti)
-        XCTAssertEqual(d1.compare(d2), NSComparisonResult.OrderedAscending)
+        XCTAssertEqual(d1.compare(d2), NSComparisonResult.orderedAscending)
     }
     
     func test_IsEqualToDate() {
diff --git a/TestFoundation/TestNSNumber.swift b/TestFoundation/TestNSNumber.swift
index d480180..dcddf38 100644
--- a/TestFoundation/TestNSNumber.swift
+++ b/TestFoundation/TestNSNumber.swift
@@ -275,130 +275,130 @@
     }
 
     func test_compareNumberWithBool() {
-        XCTAssertEqual(NSNumber(value: true).compare(NSNumber(value: true)), NSComparisonResult.OrderedSame)
-        XCTAssertEqual(NSNumber(value: true).compare(NSNumber(value: false)), NSComparisonResult.OrderedDescending)
-        XCTAssertEqual(NSNumber(value: false).compare(NSNumber(value: true)), NSComparisonResult.OrderedAscending)
+        XCTAssertEqual(NSNumber(value: true).compare(NSNumber(value: true)), NSComparisonResult.orderedSame)
+        XCTAssertEqual(NSNumber(value: true).compare(NSNumber(value: false)), NSComparisonResult.orderedDescending)
+        XCTAssertEqual(NSNumber(value: false).compare(NSNumber(value: true)), NSComparisonResult.orderedAscending)
 
-        XCTAssertEqual(NSNumber(value: false).compare(NSNumber(value: Int8(0))), NSComparisonResult.OrderedSame)
+        XCTAssertEqual(NSNumber(value: false).compare(NSNumber(value: Int8(0))), NSComparisonResult.orderedSame)
 #if !(os(Linux) && arch(arm))
         // Linux/arm chars are unsigned, so Int8 in Swift, until this issue is resolved, this test will always fail.
-        XCTAssertEqual(NSNumber(value: false).compare(NSNumber(value: Int8(-1))), NSComparisonResult.OrderedDescending)
+        XCTAssertEqual(NSNumber(value: false).compare(NSNumber(value: Int8(-1))), NSComparisonResult.orderedDescending)
 #endif
-        XCTAssertEqual(NSNumber(value: false).compare(NSNumber(value: Int8(1))), NSComparisonResult.OrderedAscending)
+        XCTAssertEqual(NSNumber(value: false).compare(NSNumber(value: Int8(1))), NSComparisonResult.orderedAscending)
 
-        XCTAssertEqual(NSNumber(value: true).compare(NSNumber(value: Int8(1))), NSComparisonResult.OrderedSame)
-        XCTAssertEqual(NSNumber(value: true).compare(NSNumber(value: Int8(0))), NSComparisonResult.OrderedDescending)
-        XCTAssertEqual(NSNumber(value: true).compare(NSNumber(value: Int8(2))), NSComparisonResult.OrderedAscending)
+        XCTAssertEqual(NSNumber(value: true).compare(NSNumber(value: Int8(1))), NSComparisonResult.orderedSame)
+        XCTAssertEqual(NSNumber(value: true).compare(NSNumber(value: Int8(0))), NSComparisonResult.orderedDescending)
+        XCTAssertEqual(NSNumber(value: true).compare(NSNumber(value: Int8(2))), NSComparisonResult.orderedAscending)
 
-        XCTAssertEqual(NSNumber(value: false).compare(NSNumber(value: Double(0))), NSComparisonResult.OrderedSame)
-        XCTAssertEqual(NSNumber(value: false).compare(NSNumber(value: Double(-0.1))), NSComparisonResult.OrderedDescending)
-        XCTAssertEqual(NSNumber(value: false).compare(NSNumber(value: Double(0.1))), NSComparisonResult.OrderedAscending)
+        XCTAssertEqual(NSNumber(value: false).compare(NSNumber(value: Double(0))), NSComparisonResult.orderedSame)
+        XCTAssertEqual(NSNumber(value: false).compare(NSNumber(value: Double(-0.1))), NSComparisonResult.orderedDescending)
+        XCTAssertEqual(NSNumber(value: false).compare(NSNumber(value: Double(0.1))), NSComparisonResult.orderedAscending)
 
-        XCTAssertEqual(NSNumber(value: true).compare(NSNumber(value: Double(1))), NSComparisonResult.OrderedSame)
-        XCTAssertEqual(NSNumber(value: true).compare(NSNumber(value: Double(0.9))), NSComparisonResult.OrderedDescending)
-        XCTAssertEqual(NSNumber(value: true).compare(NSNumber(value: Double(1.1))), NSComparisonResult.OrderedAscending)
+        XCTAssertEqual(NSNumber(value: true).compare(NSNumber(value: Double(1))), NSComparisonResult.orderedSame)
+        XCTAssertEqual(NSNumber(value: true).compare(NSNumber(value: Double(0.9))), NSComparisonResult.orderedDescending)
+        XCTAssertEqual(NSNumber(value: true).compare(NSNumber(value: Double(1.1))), NSComparisonResult.orderedAscending)
     }
 
     func test_compareNumberWithChar() {
-        XCTAssertEqual(NSNumber(value: Int8(42)).compare(NSNumber(value: Int8(42))), NSComparisonResult.OrderedSame)
-        XCTAssertEqual(NSNumber(value: Int8(42)).compare(NSNumber(value: Int8(0))), NSComparisonResult.OrderedDescending)
+        XCTAssertEqual(NSNumber(value: Int8(42)).compare(NSNumber(value: Int8(42))), NSComparisonResult.orderedSame)
+        XCTAssertEqual(NSNumber(value: Int8(42)).compare(NSNumber(value: Int8(0))), NSComparisonResult.orderedDescending)
 #if !(os(Linux) && arch(arm))
         // Linux/arm chars are unsigned, so Int8 in Swift, until this issue is resolved, this test will always fail.
-        XCTAssertEqual(NSNumber(value: Int8(-37)).compare(NSNumber(value: Int8(16))), NSComparisonResult.OrderedAscending)
+        XCTAssertEqual(NSNumber(value: Int8(-37)).compare(NSNumber(value: Int8(16))), NSComparisonResult.orderedAscending)
 #endif
 
-        XCTAssertEqual(NSNumber(value: Int8(1)).compare(NSNumber(value: true)), NSComparisonResult.OrderedSame)
-        XCTAssertEqual(NSNumber(value: Int8(1)).compare(NSNumber(value: false)), NSComparisonResult.OrderedDescending)
+        XCTAssertEqual(NSNumber(value: Int8(1)).compare(NSNumber(value: true)), NSComparisonResult.orderedSame)
+        XCTAssertEqual(NSNumber(value: Int8(1)).compare(NSNumber(value: false)), NSComparisonResult.orderedDescending)
 #if !(os(Linux) && arch(arm))
         // Linux/arm chars are unsigned, so Int8 in Swift, until this issue is resolved, this test will always fail.
-        XCTAssertEqual(NSNumber(value: Int8(-37)).compare(NSNumber(value: true)), NSComparisonResult.OrderedAscending)
+        XCTAssertEqual(NSNumber(value: Int8(-37)).compare(NSNumber(value: true)), NSComparisonResult.orderedAscending)
 #endif
 
-        XCTAssertEqual(NSNumber(value: Int8(42)).compare(NSNumber(value: UInt8(42))), NSComparisonResult.OrderedSame)
-        XCTAssertEqual(NSNumber(value: Int8(42)).compare(NSNumber(value: UInt8(16))), NSComparisonResult.OrderedDescending)
+        XCTAssertEqual(NSNumber(value: Int8(42)).compare(NSNumber(value: UInt8(42))), NSComparisonResult.orderedSame)
+        XCTAssertEqual(NSNumber(value: Int8(42)).compare(NSNumber(value: UInt8(16))), NSComparisonResult.orderedDescending)
 #if !(os(Linux) && arch(arm))
         // Linux/arm chars are unsigned, so Int8 in Swift, until this issue is resolved, this test will always fail.
-        XCTAssertEqual(NSNumber(value: Int8(-37)).compare(NSNumber(value: UInt8(255))), NSComparisonResult.OrderedAscending)
+        XCTAssertEqual(NSNumber(value: Int8(-37)).compare(NSNumber(value: UInt8(255))), NSComparisonResult.orderedAscending)
 #endif
 
-        XCTAssertEqual(NSNumber(value: Int8(42)).compare(NSNumber(value: Float(42))), NSComparisonResult.OrderedSame)
+        XCTAssertEqual(NSNumber(value: Int8(42)).compare(NSNumber(value: Float(42))), NSComparisonResult.orderedSame)
 #if !(os(Linux) && arch(arm))
         // Linux/arm chars are unsigned, so Int8 in Swift, until this issue is resolved, this test will always fail.
-        XCTAssertEqual(NSNumber(value: Int8(-16)).compare(NSNumber(value: Float(-37.5))), NSComparisonResult.OrderedDescending)
+        XCTAssertEqual(NSNumber(value: Int8(-16)).compare(NSNumber(value: Float(-37.5))), NSComparisonResult.orderedDescending)
 #endif
-        XCTAssertEqual(NSNumber(value: Int8(16)).compare(NSNumber(value: Float(16.1))), NSComparisonResult.OrderedAscending)
+        XCTAssertEqual(NSNumber(value: Int8(16)).compare(NSNumber(value: Float(16.1))), NSComparisonResult.orderedAscending)
     }
 
     func test_compareNumberWithUnsignedChar() {
-        XCTAssertEqual(NSNumber(value: UInt8(42)).compare(NSNumber(value: UInt8(42))), NSComparisonResult.OrderedSame)
-        XCTAssertEqual(NSNumber(value: UInt8(42)).compare(NSNumber(value: UInt8(0))), NSComparisonResult.OrderedDescending)
-//        XCTAssertEqual(NSNumber(value: UInt8(42)).compare(NSNumber(value: UInt8(255))), NSComparisonResult.OrderedAscending)
+        XCTAssertEqual(NSNumber(value: UInt8(42)).compare(NSNumber(value: UInt8(42))), NSComparisonResult.orderedSame)
+        XCTAssertEqual(NSNumber(value: UInt8(42)).compare(NSNumber(value: UInt8(0))), NSComparisonResult.orderedDescending)
+//        XCTAssertEqual(NSNumber(value: UInt8(42)).compare(NSNumber(value: UInt8(255))), NSComparisonResult.orderedAscending)
 
-        XCTAssertEqual(NSNumber(value: UInt8(1)).compare(NSNumber(value: true)), NSComparisonResult.OrderedSame)
-        XCTAssertEqual(NSNumber(value: UInt8(1)).compare(NSNumber(value: false)), NSComparisonResult.OrderedDescending)
-        XCTAssertEqual(NSNumber(value: UInt8(0)).compare(NSNumber(value: true)), NSComparisonResult.OrderedAscending)
+        XCTAssertEqual(NSNumber(value: UInt8(1)).compare(NSNumber(value: true)), NSComparisonResult.orderedSame)
+        XCTAssertEqual(NSNumber(value: UInt8(1)).compare(NSNumber(value: false)), NSComparisonResult.orderedDescending)
+        XCTAssertEqual(NSNumber(value: UInt8(0)).compare(NSNumber(value: true)), NSComparisonResult.orderedAscending)
 
-        XCTAssertEqual(NSNumber(value: UInt8(42)).compare(NSNumber(value: Int16(42))), NSComparisonResult.OrderedSame)
-        XCTAssertEqual(NSNumber(value: UInt8(0)).compare(NSNumber(value: Int16(-123))), NSComparisonResult.OrderedDescending)
-        XCTAssertEqual(NSNumber(value: UInt8(255)).compare(NSNumber(value: Int16(12345))), NSComparisonResult.OrderedAscending)
+        XCTAssertEqual(NSNumber(value: UInt8(42)).compare(NSNumber(value: Int16(42))), NSComparisonResult.orderedSame)
+        XCTAssertEqual(NSNumber(value: UInt8(0)).compare(NSNumber(value: Int16(-123))), NSComparisonResult.orderedDescending)
+        XCTAssertEqual(NSNumber(value: UInt8(255)).compare(NSNumber(value: Int16(12345))), NSComparisonResult.orderedAscending)
 
-        XCTAssertEqual(NSNumber(value: UInt8(42)).compare(NSNumber(value: Float(42))), NSComparisonResult.OrderedSame)
-        XCTAssertEqual(NSNumber(value: UInt8(0)).compare(NSNumber(value: Float(-37.5))), NSComparisonResult.OrderedDescending)
-        XCTAssertEqual(NSNumber(value: UInt8(255)).compare(NSNumber(value: Float(1234.5))), NSComparisonResult.OrderedAscending)
+        XCTAssertEqual(NSNumber(value: UInt8(42)).compare(NSNumber(value: Float(42))), NSComparisonResult.orderedSame)
+        XCTAssertEqual(NSNumber(value: UInt8(0)).compare(NSNumber(value: Float(-37.5))), NSComparisonResult.orderedDescending)
+        XCTAssertEqual(NSNumber(value: UInt8(255)).compare(NSNumber(value: Float(1234.5))), NSComparisonResult.orderedAscending)
     }
 
     func test_compareNumberWithShort() {
-        XCTAssertEqual(NSNumber(value: Int16(42)).compare(NSNumber(value: Int16(42))), NSComparisonResult.OrderedSame)
-        XCTAssertEqual(NSNumber(value: Int16(42)).compare(NSNumber(value: Int16(0))), NSComparisonResult.OrderedDescending)
-        XCTAssertEqual(NSNumber(value: Int16(-37)).compare(NSNumber(value: Int16(12345))), NSComparisonResult.OrderedAscending)
+        XCTAssertEqual(NSNumber(value: Int16(42)).compare(NSNumber(value: Int16(42))), NSComparisonResult.orderedSame)
+        XCTAssertEqual(NSNumber(value: Int16(42)).compare(NSNumber(value: Int16(0))), NSComparisonResult.orderedDescending)
+        XCTAssertEqual(NSNumber(value: Int16(-37)).compare(NSNumber(value: Int16(12345))), NSComparisonResult.orderedAscending)
 
-        XCTAssertEqual(NSNumber(value: Int16(1)).compare(NSNumber(value: true)), NSComparisonResult.OrderedSame)
-        XCTAssertEqual(NSNumber(value: Int16(1)).compare(NSNumber(value: false)), NSComparisonResult.OrderedDescending)
-        XCTAssertEqual(NSNumber(value: Int16(0)).compare(NSNumber(value: true)), NSComparisonResult.OrderedAscending)
+        XCTAssertEqual(NSNumber(value: Int16(1)).compare(NSNumber(value: true)), NSComparisonResult.orderedSame)
+        XCTAssertEqual(NSNumber(value: Int16(1)).compare(NSNumber(value: false)), NSComparisonResult.orderedDescending)
+        XCTAssertEqual(NSNumber(value: Int16(0)).compare(NSNumber(value: true)), NSComparisonResult.orderedAscending)
 
-        XCTAssertEqual(NSNumber(value: Int16(42)).compare(NSNumber(value: UInt8(42))), NSComparisonResult.OrderedSame)
-        XCTAssertEqual(NSNumber(value: Int16(42)).compare(NSNumber(value: UInt8(0))), NSComparisonResult.OrderedDescending)
-        XCTAssertEqual(NSNumber(value: Int16(-37)).compare(NSNumber(value: UInt8(255))), NSComparisonResult.OrderedAscending)
+        XCTAssertEqual(NSNumber(value: Int16(42)).compare(NSNumber(value: UInt8(42))), NSComparisonResult.orderedSame)
+        XCTAssertEqual(NSNumber(value: Int16(42)).compare(NSNumber(value: UInt8(0))), NSComparisonResult.orderedDescending)
+        XCTAssertEqual(NSNumber(value: Int16(-37)).compare(NSNumber(value: UInt8(255))), NSComparisonResult.orderedAscending)
 
-        XCTAssertEqual(NSNumber(value: Int16(42)).compare(NSNumber(value: Float(42))), NSComparisonResult.OrderedSame)
-        XCTAssertEqual(NSNumber(value: Int16(0)).compare(NSNumber(value: Float(-37.5))), NSComparisonResult.OrderedDescending)
-        XCTAssertEqual(NSNumber(value: Int16(255)).compare(NSNumber(value: Float(1234.5))), NSComparisonResult.OrderedAscending)
+        XCTAssertEqual(NSNumber(value: Int16(42)).compare(NSNumber(value: Float(42))), NSComparisonResult.orderedSame)
+        XCTAssertEqual(NSNumber(value: Int16(0)).compare(NSNumber(value: Float(-37.5))), NSComparisonResult.orderedDescending)
+        XCTAssertEqual(NSNumber(value: Int16(255)).compare(NSNumber(value: Float(1234.5))), NSComparisonResult.orderedAscending)
     }
 
     func test_compareNumberWithFloat() {
-        XCTAssertEqual(NSNumber(value: Float(42)).compare(NSNumber(value: Float(42))), NSComparisonResult.OrderedSame)
-        XCTAssertEqual(NSNumber(value: Float(42)).compare(NSNumber(value: Float(0))), NSComparisonResult.OrderedDescending)
-        XCTAssertEqual(NSNumber(value: Float(-37)).compare(NSNumber(value: Float(12345))), NSComparisonResult.OrderedAscending)
+        XCTAssertEqual(NSNumber(value: Float(42)).compare(NSNumber(value: Float(42))), NSComparisonResult.orderedSame)
+        XCTAssertEqual(NSNumber(value: Float(42)).compare(NSNumber(value: Float(0))), NSComparisonResult.orderedDescending)
+        XCTAssertEqual(NSNumber(value: Float(-37)).compare(NSNumber(value: Float(12345))), NSComparisonResult.orderedAscending)
 
-        XCTAssertEqual(NSNumber(value: Float(1)).compare(NSNumber(value: true)), NSComparisonResult.OrderedSame)
-        XCTAssertEqual(NSNumber(value: Float(0.1)).compare(NSNumber(value: false)), NSComparisonResult.OrderedDescending)
-        XCTAssertEqual(NSNumber(value: Float(0.9)).compare(NSNumber(value: true)), NSComparisonResult.OrderedAscending)
+        XCTAssertEqual(NSNumber(value: Float(1)).compare(NSNumber(value: true)), NSComparisonResult.orderedSame)
+        XCTAssertEqual(NSNumber(value: Float(0.1)).compare(NSNumber(value: false)), NSComparisonResult.orderedDescending)
+        XCTAssertEqual(NSNumber(value: Float(0.9)).compare(NSNumber(value: true)), NSComparisonResult.orderedAscending)
 
-        XCTAssertEqual(NSNumber(value: Float(42)).compare(NSNumber(value: UInt8(42))), NSComparisonResult.OrderedSame)
-        XCTAssertEqual(NSNumber(value: Float(0.1)).compare(NSNumber(value: UInt8(0))), NSComparisonResult.OrderedDescending)
-        XCTAssertEqual(NSNumber(value: Float(-254.9)).compare(NSNumber(value: UInt8(255))), NSComparisonResult.OrderedAscending)
+        XCTAssertEqual(NSNumber(value: Float(42)).compare(NSNumber(value: UInt8(42))), NSComparisonResult.orderedSame)
+        XCTAssertEqual(NSNumber(value: Float(0.1)).compare(NSNumber(value: UInt8(0))), NSComparisonResult.orderedDescending)
+        XCTAssertEqual(NSNumber(value: Float(-254.9)).compare(NSNumber(value: UInt8(255))), NSComparisonResult.orderedAscending)
 
-        XCTAssertEqual(NSNumber(value: Float(42)).compare(NSNumber(value: Double(42))), NSComparisonResult.OrderedSame)
-        XCTAssertEqual(NSNumber(value: Float(0)).compare(NSNumber(value: Double(-37.5))), NSComparisonResult.OrderedDescending)
-        XCTAssertEqual(NSNumber(value: Float(-37.5)).compare(NSNumber(value: Double(1234.5))), NSComparisonResult.OrderedAscending)
+        XCTAssertEqual(NSNumber(value: Float(42)).compare(NSNumber(value: Double(42))), NSComparisonResult.orderedSame)
+        XCTAssertEqual(NSNumber(value: Float(0)).compare(NSNumber(value: Double(-37.5))), NSComparisonResult.orderedDescending)
+        XCTAssertEqual(NSNumber(value: Float(-37.5)).compare(NSNumber(value: Double(1234.5))), NSComparisonResult.orderedAscending)
     }
 
     func test_compareNumberWithDouble() {
-        XCTAssertEqual(NSNumber(value: Double(42)).compare(NSNumber(value: Double(42))), NSComparisonResult.OrderedSame)
-        XCTAssertEqual(NSNumber(value: Double(42)).compare(NSNumber(value: Double(0))), NSComparisonResult.OrderedDescending)
-        XCTAssertEqual(NSNumber(value: Double(-37)).compare(NSNumber(value: Double(12345))), NSComparisonResult.OrderedAscending)
+        XCTAssertEqual(NSNumber(value: Double(42)).compare(NSNumber(value: Double(42))), NSComparisonResult.orderedSame)
+        XCTAssertEqual(NSNumber(value: Double(42)).compare(NSNumber(value: Double(0))), NSComparisonResult.orderedDescending)
+        XCTAssertEqual(NSNumber(value: Double(-37)).compare(NSNumber(value: Double(12345))), NSComparisonResult.orderedAscending)
 
-        XCTAssertEqual(NSNumber(value: Double(1)).compare(NSNumber(value: true)), NSComparisonResult.OrderedSame)
-        XCTAssertEqual(NSNumber(value: Double(0.1)).compare(NSNumber(value: false)), NSComparisonResult.OrderedDescending)
-        XCTAssertEqual(NSNumber(value: Double(0.9)).compare(NSNumber(value: true)), NSComparisonResult.OrderedAscending)
+        XCTAssertEqual(NSNumber(value: Double(1)).compare(NSNumber(value: true)), NSComparisonResult.orderedSame)
+        XCTAssertEqual(NSNumber(value: Double(0.1)).compare(NSNumber(value: false)), NSComparisonResult.orderedDescending)
+        XCTAssertEqual(NSNumber(value: Double(0.9)).compare(NSNumber(value: true)), NSComparisonResult.orderedAscending)
 
-        XCTAssertEqual(NSNumber(value: Double(42)).compare(NSNumber(value: UInt8(42))), NSComparisonResult.OrderedSame)
-        XCTAssertEqual(NSNumber(value: Double(0.1)).compare(NSNumber(value: UInt8(0))), NSComparisonResult.OrderedDescending)
-        XCTAssertEqual(NSNumber(value: Double(-254.9)).compare(NSNumber(value: UInt8(255))), NSComparisonResult.OrderedAscending)
+        XCTAssertEqual(NSNumber(value: Double(42)).compare(NSNumber(value: UInt8(42))), NSComparisonResult.orderedSame)
+        XCTAssertEqual(NSNumber(value: Double(0.1)).compare(NSNumber(value: UInt8(0))), NSComparisonResult.orderedDescending)
+        XCTAssertEqual(NSNumber(value: Double(-254.9)).compare(NSNumber(value: UInt8(255))), NSComparisonResult.orderedAscending)
 
-        XCTAssertEqual(NSNumber(value: Double(42)).compare(NSNumber(value: Float(42))), NSComparisonResult.OrderedSame)
-        XCTAssertEqual(NSNumber(value: Double(0)).compare(NSNumber(value: Float(-37.5))), NSComparisonResult.OrderedDescending)
-        XCTAssertEqual(NSNumber(value: Double(-37.5)).compare(NSNumber(value: Float(1234.5))), NSComparisonResult.OrderedAscending)
+        XCTAssertEqual(NSNumber(value: Double(42)).compare(NSNumber(value: Float(42))), NSComparisonResult.orderedSame)
+        XCTAssertEqual(NSNumber(value: Double(0)).compare(NSNumber(value: Float(-37.5))), NSComparisonResult.orderedDescending)
+        XCTAssertEqual(NSNumber(value: Double(-37.5)).compare(NSNumber(value: Float(1234.5))), NSComparisonResult.orderedAscending)
     }
 
     func test_reflection() {
diff --git a/TestFoundation/TestNSOrderedSet.swift b/TestFoundation/TestNSOrderedSet.swift
index 867bc2a..52c765a 100644
--- a/TestFoundation/TestNSOrderedSet.swift
+++ b/TestFoundation/TestNSOrderedSet.swift
@@ -347,7 +347,7 @@
             if let lhs = lhs as? NSString, rhs = rhs as? NSString {
                 return lhs.compare(rhs.bridge())
             }
-            return NSComparisonResult.OrderedSame
+            return NSComparisonResult.orderedSame
         }
         XCTAssertEqual(set[0] as? NSString, "a")
         XCTAssertEqual(set[1] as? NSString, "b")
@@ -358,7 +358,7 @@
             if let lhs = lhs as? NSString, rhs = rhs as? NSString {
                 return rhs.compare(lhs.bridge())
             }
-            return NSComparisonResult.OrderedSame
+            return NSComparisonResult.orderedSame
         }
         XCTAssertEqual(set[0] as? NSString, "a")
         XCTAssertEqual(set[1] as? NSString, "c")
diff --git a/TestFoundation/TestNSString.swift b/TestFoundation/TestNSString.swift
index eb9de70..feb521c 100644
--- a/TestFoundation/TestNSString.swift
+++ b/TestFoundation/TestNSString.swift
@@ -594,7 +594,7 @@
     }
     
     private func stringsAreCaseInsensitivelyEqual(_ lhs: NSString, _ rhs: NSString) -> Bool {
-    	return lhs.compare(rhs.bridge(), options: .caseInsensitiveSearch) == .OrderedSame
+    	return lhs.compare(rhs.bridge(), options: .caseInsensitiveSearch) == .orderedSame
     }
 
     func test_stringByTrimmingCharactersInSet() {