summaryrefslogtreecommitdiffhomepage
path: root/ios/MullvadRESTTests/ShadowsocksLoaderStub.swift
blob: 973ea954a05bd076b7e91e3ac8137ba383e6a9a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//
//  ShadowsocksLoaderStub.swift
//  MullvadRESTTests
//
//  Created by Mojgan on 2024-01-08.
//  Copyright © 2024 Mullvad VPN AB. All rights reserved.
//

import Foundation
@testable import MullvadREST
import MullvadSettings
import MullvadTypes

struct ShadowsocksLoaderStub: ShadowsocksLoaderProtocol {
    var configuration: ShadowsocksConfiguration
    var error: Error?

    func clear() throws {
        try load()
    }

    @discardableResult
    func load() throws -> ShadowsocksConfiguration {
        if let error { throw error }
        return configuration
    }
}