BolusNormalPumpEventTests.swift 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. //
  2. // BolusNormalPumpEventTests.swift
  3. // RileyLink
  4. //
  5. // Created by Jaim Zuber on 3/8/17.
  6. // Copyright © 2017 Pete Schwamb. All rights reserved.
  7. //
  8. import XCTest
  9. @testable import MinimedKit
  10. class BolusNormalPumpEventTests: XCTestCase {
  11. let data523 = Data(hexadecimalString: "01009000900058008a344b1010")!
  12. var bolusPumpEvent523: BolusNormalPumpEvent!
  13. override func setUp() {
  14. super.setUp()
  15. bolusPumpEvent523 = BolusNormalPumpEvent(availableData: data523, pumpModel: PumpModel.model523)!
  16. }
  17. func test523Year() {
  18. XCTAssertEqual(bolusPumpEvent523.timestamp.year, 2016)
  19. }
  20. func test523Month() {
  21. XCTAssertEqual(bolusPumpEvent523.timestamp.month, 8)
  22. }
  23. func test523RawData() {
  24. XCTAssertEqual(bolusPumpEvent523.rawData, data523)
  25. }
  26. func test523Duration() {
  27. XCTAssertEqual(bolusPumpEvent523.duration, 0.0)
  28. }
  29. func test523Length() {
  30. XCTAssertEqual(bolusPumpEvent523.length, 13)
  31. }
  32. func test523Type() {
  33. XCTAssertEqual(bolusPumpEvent523.type, .normal)
  34. }
  35. func test523UnabsorbedInsulinTotal() {
  36. XCTAssertEqual(bolusPumpEvent523.unabsorbedInsulinTotal, 2.2)
  37. }
  38. func test523Programmed() {
  39. XCTAssertEqual(bolusPumpEvent523.programmed, 3.6)
  40. }
  41. func test523Amount() {
  42. XCTAssertEqual(bolusPumpEvent523.amount, 3.6)
  43. }
  44. }