p2635 / ios-swift-tallest-towers-app

My first test project for practising Unit and UI tests in Swift. The linked website is the article that I followed.
https://semaphoreci.com/blog/xcode-unit-testing-tutorial
MIT License
0 stars 0 forks source link

`accuracy` is not working when using XCTAssert #5

Closed p2635 closed 1 year ago

p2635 commented 1 year ago

accuracy is not part of XCTAssert, use XCTAssertEqual.

This will throw an error.

func testLocationShouldBeCreatedFromLatitudeAndLongitudeProperties() {
    XCTAssert(subject.location.latitude == 35.6583, accuracy: 0.00001)
    XCTAssert(subject.location.longitude == 139.773, accuracy: 0.00001)
}
func testLocationShouldBeCreatedFromLatitudeAndLongitudeProperties() {
    XCTAssertEqual(subject.location.latitude, 35.6583, accuracy: 0.00001)
    XCTAssertEqual(subject.location.longitude, 139.773, accuracy: 0.00001)
}