diff --git a/IntroductionToMocking/IntroductionToMocking.xcodeproj/project.pbxproj b/IntroductionToMocking/IntroductionToMocking.xcodeproj/project.pbxproj index 1a0d2d4..ea849d8 100644 --- a/IntroductionToMocking/IntroductionToMocking.xcodeproj/project.pbxproj +++ b/IntroductionToMocking/IntroductionToMocking.xcodeproj/project.pbxproj @@ -464,7 +464,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.4; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -518,7 +518,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.4; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = iphoneos; @@ -537,7 +537,7 @@ DEVELOPMENT_TEAM = B2Q8EGNCQA; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = IntroductionToMocking/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.4; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -558,7 +558,7 @@ DEVELOPMENT_TEAM = B2Q8EGNCQA; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = IntroductionToMocking/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.4; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", diff --git a/IntroductionToMocking/IntroductionToMocking/Factories/HTTPClientFactory.swift b/IntroductionToMocking/IntroductionToMocking/Factories/HTTPClientFactory.swift index e280552..92dbd8a 100644 --- a/IntroductionToMocking/IntroductionToMocking/Factories/HTTPClientFactory.swift +++ b/IntroductionToMocking/IntroductionToMocking/Factories/HTTPClientFactory.swift @@ -9,15 +9,7 @@ import Foundation class HTTPClientFactory { - static func create() -> HTTPClientProtocol { - - let enviromment = ProcessInfo.processInfo.environment["ENV"] - if enviromment == "TEST" { - return MockedHTTPClient() - } else { - return HTTPClient() - } + ProcessInfo.processInfo.environment["mockingEnvironment", default: "False"] == "True" ? MockedHTTPClient() : HTTPClient() } - } diff --git a/IntroductionToMocking/IntroductionToMockingTests/IntroductionToMockingTests.swift b/IntroductionToMocking/IntroductionToMockingTests/IntroductionToMockingTests.swift index 321663f..2dc95c3 100644 --- a/IntroductionToMocking/IntroductionToMockingTests/IntroductionToMockingTests.swift +++ b/IntroductionToMocking/IntroductionToMockingTests/IntroductionToMockingTests.swift @@ -1,34 +1,34 @@ -// + // IntroductionToMockingTests.swift // IntroductionToMockingTests // // Created by Mohammad Azam on 4/25/20. // Copyright © 2020 Mohammad Azam. All rights reserved. -// -//import XCTest + +import XCTest //@testable import IntroductionToMocking -//class IntroductionToMockingTests: XCTestCase { -// -// override func setUpWithError() throws { -// // Put setup code here. This method is called before the invocation of each test method in the class. -// } -// -// override func tearDownWithError() throws { -// // 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. -// } -// -// 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. -// } -// } -// -//} +class IntroductionToMockingTests: XCTestCase { + + override func setUpWithError() throws { + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDownWithError() throws { + // 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. + } + + 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. + } + } + +} diff --git a/IntroductionToMocking/IntroductionToMockingUITests/IntroductionToMockingUITests.swift b/IntroductionToMocking/IntroductionToMockingUITests/IntroductionToMockingUITests.swift index 60417d3..1dc313d 100644 --- a/IntroductionToMocking/IntroductionToMockingUITests/IntroductionToMockingUITests.swift +++ b/IntroductionToMocking/IntroductionToMockingUITests/IntroductionToMockingUITests.swift @@ -17,7 +17,7 @@ class when_user_login_successfully: XCTestCase { super.setUp() self.app = XCUIApplication() self.continueAfterFailure = true - self.app.launchEnvironment = ["ENV": "TEST"] + self.app.launchEnvironment = ["mockingEnvironment": "True"] self.app.launch() } diff --git a/IntroductionToMocking/IntroductionToMockingUITests/Mocks/MockedHTTPClient.swift b/IntroductionToMocking/IntroductionToMockingUITests/Mocks/MockedHTTPClient.swift index 53fe08c..dab6ae8 100644 --- a/IntroductionToMocking/IntroductionToMockingUITests/Mocks/MockedHTTPClient.swift +++ b/IntroductionToMocking/IntroductionToMockingUITests/Mocks/MockedHTTPClient.swift @@ -7,7 +7,7 @@ // import Foundation -@testable import IntroductionToMocking +//@testable import IntroductionToMocking This doesn't make any sense class MockedHTTPClient: HTTPClientProtocol { diff --git a/ValidationSwiftUI/ValidationSwiftUI.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ValidationSwiftUI/ValidationSwiftUI.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 7929ba8..919434a 100644 --- a/ValidationSwiftUI/ValidationSwiftUI.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/ValidationSwiftUI/ValidationSwiftUI.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:">