38 lines
876 B
Swift
38 lines
876 B
Swift
import Testing
|
|
import Foundation
|
|
@testable import IMAPClient
|
|
import Models
|
|
|
|
@Suite("IMAPIdleClient")
|
|
struct IMAPIdleClientTests {
|
|
|
|
@Test("IMAPIdleClient can be initialized")
|
|
func initialization() {
|
|
let client = IMAPIdleClient(
|
|
host: "imap.example.com",
|
|
port: 993,
|
|
credentials: Credentials(username: "user", password: "pass")
|
|
)
|
|
// Just verify it compiles and initializes — actual IDLE testing
|
|
// requires a real server or more sophisticated mocking
|
|
#expect(true)
|
|
}
|
|
|
|
@Test("IMAPIdleEvent cases exist")
|
|
func eventCases() {
|
|
let exists = IMAPIdleEvent.exists(42)
|
|
let expunge = IMAPIdleEvent.expunge(1)
|
|
let terminated = IMAPIdleEvent.idleTerminated
|
|
|
|
if case .exists(let count) = exists {
|
|
#expect(count == 42)
|
|
}
|
|
if case .expunge(let num) = expunge {
|
|
#expect(num == 1)
|
|
}
|
|
if case .idleTerminated = terminated {
|
|
#expect(true)
|
|
}
|
|
}
|
|
}
|