(t *testing.T)
| 26 | func (*TestDrawable) Close() {} |
| 27 | |
| 28 | func TestNewAnimationComponent(t *testing.T) { |
| 29 | drawables := []Drawable{ |
| 30 | &TestDrawable{0}, |
| 31 | &TestDrawable{1}, |
| 32 | &TestDrawable{2}, |
| 33 | } |
| 34 | ac := NewAnimationComponent(drawables, 0.1) |
| 35 | if len(ac.Animations) != 0 { |
| 36 | t.Errorf("NewAnimationComponent returned an already populated map of animations") |
| 37 | } |
| 38 | if len(ac.Drawables) != len(drawables) { |
| 39 | t.Errorf("NewAnimationComponent drawables length did not match specified drawables") |
| 40 | } |
| 41 | if ac.Rate != 0.1 { |
| 42 | t.Errorf("NewAnimationComponent Rate did not match passed in value") |
| 43 | } |
| 44 | if ac.CurrentAnimation != nil { |
| 45 | t.Errorf("NewAnimationComponent initalized CurrentAnimation with a value") |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | func TestAnimationComponentSelectAnimationByName(t *testing.T) { |
| 50 | drawables := []Drawable{ |
nothing calls this directly
no test coverage detected