| 60 | } |
| 61 | |
| 62 | func 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 | |
| 92 | func TestCameraZoom(t *testing.T) { |
| 93 | initialize() |