Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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",
Expand All @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

}
Original file line number Diff line number Diff line change
@@ -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.
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

import Foundation
@testable import IntroductionToMocking
//@testable import IntroductionToMocking This doesn't make any sense

class MockedHTTPClient: HTTPClientProtocol {

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.