2023-11-21 15:12:13 +01:00
|
|
|
package models
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/remogatto/prettytest"
|
|
|
|
)
|
|
|
|
|
|
|
|
type groupTestSuite struct {
|
|
|
|
prettytest.Suite
|
|
|
|
}
|
|
|
|
|
|
|
|
func (t *groupTestSuite) TestMarshal() {
|
2023-12-05 22:11:08 +01:00
|
|
|
t.Pending()
|
2023-11-21 15:12:13 +01:00
|
|
|
|
2023-12-05 22:11:08 +01:00
|
|
|
// group := &Group{
|
|
|
|
// Name: "Example group",
|
|
|
|
// Participants: []*Participant{
|
|
|
|
// {"123", "John", "Doe", 12345, map[string]string{"class": "1 D LIN", "age": "18"}},
|
|
|
|
// {"456", "Jack", "Sparrow", 67890, map[string]string{"class": "1 D LIN", "age": "24"}},
|
|
|
|
// },
|
|
|
|
// }
|
2023-11-21 15:12:13 +01:00
|
|
|
|
2023-12-05 22:11:08 +01:00
|
|
|
// expected := `id,firstname,lastname,token,attributes
|
|
|
|
// 123,John,Doe,12345,"age:18,class:1 D LIN"
|
|
|
|
// 456,Jack,Sparrow,67890,"age:24,class:1 D LIN"
|
|
|
|
// `
|
2023-11-21 15:12:13 +01:00
|
|
|
|
2023-12-05 22:11:08 +01:00
|
|
|
// csv, err := group.Marshal()
|
|
|
|
|
|
|
|
// t.Nil(err)
|
|
|
|
// t.Equal(expected, string(csv))
|
2023-11-21 15:12:13 +01:00
|
|
|
}
|