MCPcopy Index your code
hub / github.com/EngoEngine/engo / TestCameraMoveY

Function TestCameraMoveY

common/camera_test.go:62–90  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

60}
61
62func TestCameraMoveY(t *testing.T) {
63 initialize()
64
65 currentY := cam.Y()
66
67 cam.moveX(0.50)
68 assert.Equal(t, cam.Y(), currentY, "Moving in the X direction shouldn't change the Y location")
69
70 cam.moveX(-1)
71 assert.Equal(t, cam.Y(), currentY, "Moving in the X direction shouldn't change the Y location")
72
73 cam.zoom(0.50)
74 assert.Equal(t, cam.Y(), currentY, "Zooming in should not change the Y location")
75
76 cam.zoom(-1)
77 assert.Equal(t, cam.Y(), currentY, "Zooming out should not change the Y location")
78
79 cam.moveY(10)
80 assert.Equal(t, cam.Y(), currentY+10, "Moving by 10 units, should have moved the camera by 10 units")
81
82 cam.moveY(-10)
83 assert.Equal(t, cam.Y(), currentY, "Moving by -10 units, should have moved the camera back by 10 units")
84
85 cam.moveY(305)
86 assert.Equal(t, cam.Y(), CameraBounds.Max.Y, "Moving too many unit, should have moved the camera to the maximum")
87
88 cam.moveY(-305)
89 assert.Equal(t, cam.Y(), CameraBounds.Min.Y, "Moving too many units back, should have moved the camera to the minimum")
90}
91
92func TestCameraZoom(t *testing.T) {
93 initialize()

Callers

nothing calls this directly

Calls 6

initializeFunction · 0.85
YMethod · 0.80
moveXMethod · 0.80
EqualMethod · 0.80
zoomMethod · 0.80
moveYMethod · 0.80

Tested by

no test coverage detected