Remove all the explicit type names from the tests
This commit is contained in:
parent
25abb91476
commit
8d6c48466b
1 changed files with 5 additions and 10 deletions
|
|
@ -19,40 +19,35 @@ class DiamondSquareBFSTests: XCTestCase {
|
||||||
|
|
||||||
class DiamondSquareBoxTests: XCTestCase {
|
class DiamondSquareBoxTests: XCTestCase {
|
||||||
func testNorthwest() {
|
func testNorthwest() {
|
||||||
let box = DiamondSquareAlgorithm.Box(origin: DiamondSquareAlgorithm.Box.Point(x: 3, y: 4),
|
let box = Box(origin: (x: 3, y: 4), size: (w: 5, h: 5))
|
||||||
size: DiamondSquareAlgorithm.Box.Size(w: 5, h: 5))
|
|
||||||
let pt = box.northwest
|
let pt = box.northwest
|
||||||
XCTAssertEqual(pt.x, 3)
|
XCTAssertEqual(pt.x, 3)
|
||||||
XCTAssertEqual(pt.y, 4)
|
XCTAssertEqual(pt.y, 4)
|
||||||
}
|
}
|
||||||
|
|
||||||
func testNortheast() {
|
func testNortheast() {
|
||||||
let box = DiamondSquareAlgorithm.Box(origin: DiamondSquareAlgorithm.Box.Point(x: 3, y: 4),
|
let box = Box(origin: (x: 3, y: 4), size: (w: 5, h: 5))
|
||||||
size: DiamondSquareAlgorithm.Box.Size(w: 5, h: 5))
|
|
||||||
let pt = box.northeast
|
let pt = box.northeast
|
||||||
XCTAssertEqual(pt.x, 8)
|
XCTAssertEqual(pt.x, 8)
|
||||||
XCTAssertEqual(pt.y, 4)
|
XCTAssertEqual(pt.y, 4)
|
||||||
}
|
}
|
||||||
|
|
||||||
func testSouthwest() {
|
func testSouthwest() {
|
||||||
let box = DiamondSquareAlgorithm.Box(origin: DiamondSquareAlgorithm.Box.Point(x: 3, y: 4),
|
let box = Box(origin: (x: 3, y: 4), size: (w: 5, h: 5))
|
||||||
size: DiamondSquareAlgorithm.Box.Size(w: 5, h: 5))
|
|
||||||
let pt = box.southwest
|
let pt = box.southwest
|
||||||
XCTAssertEqual(pt.x, 3)
|
XCTAssertEqual(pt.x, 3)
|
||||||
XCTAssertEqual(pt.y, 9)
|
XCTAssertEqual(pt.y, 9)
|
||||||
}
|
}
|
||||||
|
|
||||||
func testSoutheast() {
|
func testSoutheast() {
|
||||||
let box = DiamondSquareAlgorithm.Box(origin: DiamondSquareAlgorithm.Box.Point(x: 3, y: 4),
|
let box = Box(origin: (x: 3, y: 4), size: (w: 5, h: 5))
|
||||||
size: DiamondSquareAlgorithm.Box.Size(w: 5, h: 5))
|
|
||||||
let pt = box.southeast
|
let pt = box.southeast
|
||||||
XCTAssertEqual(pt.x, 8)
|
XCTAssertEqual(pt.x, 8)
|
||||||
XCTAssertEqual(pt.y, 9)
|
XCTAssertEqual(pt.y, 9)
|
||||||
}
|
}
|
||||||
|
|
||||||
func testMidpoint() {
|
func testMidpoint() {
|
||||||
let box = DiamondSquareAlgorithm.Box(origin: DiamondSquareAlgorithm.Box.Point(x: 3, y: 4),
|
let box = Box(origin: (x: 3, y: 4), size: (w: 5, h: 5))
|
||||||
size: DiamondSquareAlgorithm.Box.Size(w: 5, h: 5))
|
|
||||||
let midpoint = box.midpoint
|
let midpoint = box.midpoint
|
||||||
XCTAssertEqual(midpoint.x, 6)
|
XCTAssertEqual(midpoint.x, 6)
|
||||||
XCTAssertEqual(midpoint.y, 7)
|
XCTAssertEqual(midpoint.y, 7)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue