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

Function TestNewAnimationComponent

common/animation_test.go:28–47  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

26func (*TestDrawable) Close() {}
27
28func 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
49func TestAnimationComponentSelectAnimationByName(t *testing.T) {
50 drawables := []Drawable{

Callers

nothing calls this directly

Calls 1

NewAnimationComponentFunction · 0.85

Tested by

no test coverage detected