Externalize NWBrowser dependency in PrinterRequestManager into protocol for testing

This commit is contained in:
Madeline
2023-02-22 20:14:11 -05:00
parent 65daae4bf7
commit ff551c9a5f
6 changed files with 102 additions and 50 deletions

View File

@@ -0,0 +1,24 @@
//
// PrinterRequestsManagerTests.swift
// SoyuzTests
//
// Created by maddiefuzz on 2/21/23.
//
import XCTest
@testable import Soyuz
class FileHandleMock: FileHandle {
override func write(_ data: Data) {
return
}
}
class PrinterRequestManagerTests: XCTestCase {
var printerRequestsManager: PrinterRequestManager?
override func setUp() {
printerRequestsManager = PrinterRequestManager.shared
}
}

View File

@@ -6,7 +6,7 @@
//
import XCTest
@testable import KlipperMon
@testable import Soyuz
final class SoyuzTests: XCTestCase {
@@ -18,19 +18,19 @@ final class SoyuzTests: XCTestCase {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}
func testExample() throws {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
// Any test you write for XCTest can be annotated as throws and async.
// Mark your test throws to produce an unexpected failure when your test encounters an uncaught error.
// Mark your test async to allow awaiting for asynchronous code to complete. Check the results with assertions afterwards.
}
func testPerformanceExample() throws {
// This is an example of a performance test case.
self.measure {
// Put the code you want to measure the time of here.
}
}
// func testExample() throws {
// // This is an example of a functional test case.
// // Use XCTAssert and related functions to verify your tests produce the correct results.
// // Any test you write for XCTest can be annotated as throws and async.
// // Mark your test throws to produce an unexpected failure when your test encounters an uncaught error.
// // Mark your test async to allow awaiting for asynchronous code to complete. Check the results with assertions afterwards.
// }
//
// func testPerformanceExample() throws {
// // This is an example of a performance test case.
// self.measure {
// // Put the code you want to measure the time of here.
// }
// }
}