Skip to content

Commit d0b7997

Browse files
committed
Add tests for GraphHost/setTime(_:)
1 parent 8557fd3 commit d0b7997

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//
2+
// GraphHostTests.swift
3+
// OpenSwiftUITests
4+
5+
@testable import OpenSwiftUI
6+
import Testing
7+
8+
struct GraphHostTests {
9+
@Test
10+
func setTimeTest() {
11+
let graphHost = GraphHost(data: .init())
12+
#expect(graphHost.data.time.seconds == 0.0)
13+
14+
graphHost.setTime(Time.zero)
15+
#expect(graphHost.data.time.seconds == 0.0)
16+
17+
graphHost.setTime(Time.infinity)
18+
#expect(graphHost.data.time.seconds == Time.infinity.seconds)
19+
20+
let timeNow = Time.now
21+
graphHost.setTime(timeNow)
22+
#expect(graphHost.data.time.seconds == timeNow.seconds)
23+
}
24+
}

0 commit comments

Comments
 (0)