@@ -23,48 +23,48 @@ final class GeneralSettingsViewModelTests: XCTestCase {
2323 }
2424
2525 @MainActor
26- func test_launchAtLoginSwitched_有効の要求_成功した_有効に変更される ( ) async {
26+ func test_toggleLaunchAtLogin_有効の要求_成功した_有効に変更される ( ) async {
2727 let currentStatus = OSAllocatedUnfairLock ( initialState: SMAppService . Status. notRegistered)
2828 let smAppServiceClient = testDependency ( of: SMAppServiceClient . self) {
2929 $0. status = { currentStatus. withLock ( \. self) }
3030 $0. register = { currentStatus. withLock { $0 = . enabled } }
3131 }
3232 let sut = GeneralSettingsViewModel ( . testValue, . testValue, smAppServiceClient, . init( . testValue) )
33- sut. launchAtLoginSwitched ( true )
34- XCTAssertTrue ( sut. launchAtLoginIsEnabled )
33+ sut. toggleLaunchAtLogin ( true )
34+ XCTAssertTrue ( sut. launchAtLogin )
3535 }
3636
3737 @MainActor
38- func test_launchAtLoginSwitched_有効の要求_失敗した_無効に戻される ( ) async {
38+ func test_toggleLaunchAtLogin_有効の要求_失敗した_無効に戻される ( ) async {
3939 let smAppServiceClient = testDependency ( of: SMAppServiceClient . self) {
4040 $0. status = { . notRegistered }
4141 $0. register = { throw NSError ( domain: " " , code: kSMErrorInternalFailure) }
4242 }
4343 let sut = GeneralSettingsViewModel ( . testValue, . testValue, smAppServiceClient, . init( . testValue) )
44- sut. launchAtLoginSwitched ( true )
45- XCTAssertFalse ( sut. launchAtLoginIsEnabled )
44+ sut. toggleLaunchAtLogin ( true )
45+ XCTAssertFalse ( sut. launchAtLogin )
4646 }
4747
4848 @MainActor
49- func test_launchAtLoginSwitched_無効の要求_成功した_無効に変更される ( ) async {
49+ func test_toggleLaunchAtLogin_無効の要求_成功した_無効に変更される ( ) async {
5050 let currentStatus = OSAllocatedUnfairLock ( initialState: SMAppService . Status. enabled)
5151 let smAppServiceClient = testDependency ( of: SMAppServiceClient . self) {
5252 $0. status = { currentStatus. withLock ( \. self) }
5353 $0. unregister = { currentStatus. withLock { $0 = . notRegistered } }
5454 }
5555 let sut = GeneralSettingsViewModel ( . testValue, . testValue, smAppServiceClient, . init( . testValue) )
56- sut. launchAtLoginSwitched ( false )
57- XCTAssertFalse ( sut. launchAtLoginIsEnabled )
56+ sut. toggleLaunchAtLogin ( false )
57+ XCTAssertFalse ( sut. launchAtLogin )
5858 }
5959
6060 @MainActor
61- func test_launchAtLoginSwitched_無効の要求_失敗した_有効に戻される ( ) async {
61+ func test_toggleLaunchAtLogin_無効の要求_失敗した_有効に戻される ( ) async {
6262 let smAppServiceClient = testDependency ( of: SMAppServiceClient . self) {
6363 $0. status = { . enabled }
6464 $0. unregister = { throw NSError ( domain: " " , code: kSMErrorInternalFailure) }
6565 }
6666 let sut = GeneralSettingsViewModel ( . testValue, . testValue, smAppServiceClient, . init( . testValue) )
67- sut. launchAtLoginSwitched ( false )
68- XCTAssertTrue ( sut. launchAtLoginIsEnabled )
67+ sut. toggleLaunchAtLogin ( false )
68+ XCTAssertTrue ( sut. launchAtLogin )
6969 }
7070}
0 commit comments