Skip to content

Commit ef522e7

Browse files
committed
[NetLens][StopNetworkInterceptionUseCaseTests] - execute disable interceptor
1 parent 9af23dd commit ef522e7

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
//
2+
// NetworkCall.swift
3+
// NetLens
4+
//
5+
// Created by NetLens on 26/06/2025.
6+
//
7+
8+
import Testing
9+
@testable import NetLens
10+
11+
@Suite("Start Network interception use case")
12+
struct StopNetworkInterceptionUseCaseTests {
13+
14+
private let mockInterceptor: MockNetworkInterceptor
15+
16+
private let stopNetworkInterceptionUseCase: StopNetworkInterceptionUseCase
17+
18+
init() {
19+
20+
self.mockInterceptor = .init()
21+
22+
stopNetworkInterceptionUseCase = StopNetworkInterceptionUseCaseImpl(interceptor: mockInterceptor)
23+
}
24+
25+
@Test("Execute disable interception")
26+
func executeDisableInterception() {
27+
28+
mockInterceptor.enable()
29+
30+
#expect(mockInterceptor.isEnabled == true)
31+
32+
stopNetworkInterceptionUseCase.execute()
33+
34+
#expect(mockInterceptor.isEnabled == false)
35+
36+
#expect(mockInterceptor.disableCallCount == 1)
37+
38+
39+
}
40+
}
41+

0 commit comments

Comments
 (0)