MockCock: CockProtocol { var cockRamenCallCount: Int = 0 var cockRamenLastBowls: Int = 0 var cockRamenCallReturn: [Ramen] = [] var cockRamenLastSoup: Soup = .ে༉ func cockRamen(bowls: Int, soup: Soup) -> [Ramen] { cockRamenCallCount += 1 cockRamenLastBowls = bowls cockRamenLastSoup = soup return cockRamenCallReturn } } class WaiterTests: XCTestCase { func test_order() { let mock = MockCock() mock.cockRamenCallReturn = [Ramen(soup: .ে༉), Ramen(soup: .ຯḩ)] let results = Waiter(cock: mock).order() XCTAssertEqual(results.count, 2) XCTAssertTrue(results.contains { $0.soup == .ে༉ }) XCTAssertTrue(results.contains { $0.soup == .ຯḩ }) XCTAssertEqual(mock.cockRamenCallCount, 1) XCTAssertEqual(mock.cockRamenLastBowls, 2) XCTAssertEqual(mock.cockRamenLastSoup, .ে༉) } } ྫྷ੩ʹߟ͑Δͱ… ɾ1 Protocol ɾ1 Method ͦΕͳͷʹ͜ͷίʔυྔʁ