-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e1a811a
commit 9623257
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
TowerForge/TowerForgeTests/EventTests/DamageEventTests.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import Foundation | ||
import XCTest | ||
@testable import TowerForge | ||
|
||
final class DamageEventTests: XCTestCase { | ||
|
||
override func setUpWithError() throws { | ||
// Put setup code here. This method is called before the invocation of each test method in the class. | ||
} | ||
|
||
override func tearDownWithError() throws { | ||
// Put teardown code here. This method is called after the invocation of each test method in the class. | ||
} | ||
|
||
func test_initializeDamageEvent() { | ||
let entityId = UUID() | ||
let timestamp = 1.0 | ||
let damage = 10.0 | ||
let damageEvent = DamageEvent(on: entityId, at: timestamp, with: damage) | ||
|
||
XCTAssertEqual(damageEvent.timestamp, timestamp, | ||
"DamageEvent must have the same timestamp as originally specified") | ||
|
||
XCTAssertEqual(damageEvent.damage, damage, | ||
"DamageEvent must have the same damage as originally specified") | ||
|
||
XCTAssertEqual(damageEvent.entityId, entityId, | ||
"DamageEvent must have the same entityId as originally specified") | ||
} | ||
|
||
} |