SensorCalFactorGlucoseEventTests.swift 792 B

12345678910111213141516171819202122232425
  1. //
  2. // SensorCalFactorGlucoseEventTests.swift
  3. // RileyLink
  4. //
  5. // Created by Timothy Mecklem on 10/18/16.
  6. // Copyright © 2016 Pete Schwamb. All rights reserved.
  7. //
  8. import XCTest
  9. @testable import MinimedKit
  10. class SensorCalFactorGlucoseEventTests: XCTestCase {
  11. func testDecoding() {
  12. let rawData = Data(hexadecimalString: "0f4f67130f128c")!
  13. let subject = SensorCalFactorGlucoseEvent(availableData: rawData, relativeTimestamp: DateComponents())!
  14. let expectedTimestamp = DateComponents(calendar: Calendar(identifier: .gregorian),
  15. year: 2015, month: 5, day: 19, hour: 15, minute: 39)
  16. XCTAssertEqual(subject.timestamp, expectedTimestamp)
  17. XCTAssertEqual(subject.factor, 4.748)
  18. }
  19. }