Externalize NWBrowser dependency in PrinterRequestManager into protocol for testing
This commit is contained in:
24
SoyuzTests/PrinterRequestsManagerTests.swift
Normal file
24
SoyuzTests/PrinterRequestsManagerTests.swift
Normal 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
|
||||
}
|
||||
|
||||
}
|
@@ -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.
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user