Skip to content

Commit

Permalink
MOD Restructure TestMutableRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimitar Stefanovski authored and Dimitar Stefanovski committed May 8, 2023
1 parent adb3da8 commit 18fab79
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions Tests/GirdersSwiftTests/swift/http/TestRequestGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,6 @@ class TestMutableRequest: XCTestCase {

XCTAssertNotNil(request.parameters)
}

func mutableRequestWithQuery(_ params: Any) -> MutableRequest {
var request = mockGenerator.generateRequest(withMethod: .GET)
request.updateQueryParameters(parameters: params)
return request
}

func testQueryParametersAreProperlySetWhenURLQueryItemConfigurationIsUsed() {
let queryParameters = [URLQueryItem(name: "token1", value: "token1"),
Expand Down Expand Up @@ -150,7 +144,7 @@ class TestMutableRequest: XCTestCase {
XCTAssertNil(request.queryString)
}

func testupdateHTTPHeaderFields() {
func testUpdateHTTPHeaderFields() {
var request = mockGenerator.request(withMethod: .POST) |> mockGenerator.withBasicAuth |> mockGenerator.withJsonSupport

XCTAssertEqual(request.headerFields["Accept"], "application/json")
Expand All @@ -162,4 +156,13 @@ class TestMutableRequest: XCTestCase {

XCTAssertNotNil(request.headerFields["Test1"])
}

// MARK: - Private

private func mutableRequestWithQuery(_ params: Any) -> MutableRequest {
var request = mockGenerator.generateRequest(withMethod: .GET)
request.updateQueryParameters(parameters: params)
return request
}

}

0 comments on commit 18fab79

Please sign in to comment.