unioffice/presentation/presentation_test.go

29 lines
675 B
Go

package presentation
import (
"testing"
"github.com/unidoc/unioffice/schema/soo/pml"
)
func TestRemoveChoicesWithPics(t *testing.T) {
var choices []*pml.CT_GroupShapeChoice
var pics []*pml.CT_Picture
pics = append(pics, &pml.CT_Picture{})
choices = append(choices, pml.NewCT_GroupShapeChoice())
choices = append(choices, &pml.CT_GroupShapeChoice{
Pic: pics,
})
choices = append(choices, &pml.CT_GroupShapeChoice{
Pic: pics,
})
choices = append(choices, pml.NewCT_GroupShapeChoice())
choices = removeChoicesWithPics(choices)
for _, choice := range choices {
if len(choice.Pic) > 0 {
t.Fatal("expected to have removed all choices with pics")
}
}
}