FileStorageTests.swift 858 B

123456789101112131415161718192021222324252627
  1. @testable import FreeAPS
  2. import XCTest
  3. class FileStorageTests: XCTestCase {
  4. let fileStorage = BaseFileStorage()
  5. struct DummyObject: JSON, Equatable {
  6. let id: String
  7. let value: Decimal
  8. }
  9. func testFileStorageOiAPS() {
  10. let dummyObject = DummyObject(id: "21342Z", value: 78.2)
  11. fileStorage.save(dummyObject, as: "dummyObject")
  12. let dummyObjectRetrieve = fileStorage.retrieve("dummyObject", as: DummyObject.self)
  13. XCTAssertTrue(dummyObject == dummyObjectRetrieve)
  14. }
  15. override func setUpWithError() throws {
  16. // Put setup code here. This method is called before the invocation of each test method in the class.
  17. }
  18. override func tearDownWithError() throws {
  19. // Put teardown code here. This method is called after the invocation of each test method in the class.
  20. }
  21. }