Skip to content

Commit

Permalink
Add test to ensure comparison is valid for Mock
Browse files Browse the repository at this point in the history
  • Loading branch information
Chewie69006 committed Sep 4, 2023
1 parent ebba211 commit 30134a5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Tests/MockerTests/MockTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,13 @@ final class MockTests: XCTestCase {
XCTAssertEqual(mock200, mock400)
XCTAssertNotEqual(mock200, mockJPEG)
}

func testMethodsComparing() {
let url = URL(string: "https://mocked.wetransfer.com")!

let methods = [Mock.HTTPMethod.options, .get, .head, .post, .put, .patch, .delete, .trace, .connect]
let first = Mock(url: url, statusCode: 200, data: Dictionary(uniqueKeysWithValues: methods.shuffled().map { ($0, Data()) }))
let second = Mock(url: url, statusCode: 200, data: Dictionary(uniqueKeysWithValues: methods.shuffled().map { ($0, Data()) }))
XCTAssertEqual(first, second)
}
}

0 comments on commit 30134a5

Please sign in to comment.