group_test.go 702 B

12345678910111213141516171819202122232425262728293031
  1. package models
  2. import (
  3. "github.com/remogatto/prettytest"
  4. )
  5. type groupTestSuite struct {
  6. prettytest.Suite
  7. }
  8. func (t *groupTestSuite) TestMarshal() {
  9. t.Pending()
  10. // group := &Group{
  11. // Name: "Example group",
  12. // Participants: []*Participant{
  13. // {"123", "John", "Doe", 12345, map[string]string{"class": "1 D LIN", "age": "18"}},
  14. // {"456", "Jack", "Sparrow", 67890, map[string]string{"class": "1 D LIN", "age": "24"}},
  15. // },
  16. // }
  17. // expected := `id,firstname,lastname,token,attributes
  18. // 123,John,Doe,12345,"age:18,class:1 D LIN"
  19. // 456,Jack,Sparrow,67890,"age:24,class:1 D LIN"
  20. // `
  21. // csv, err := group.Marshal()
  22. // t.Nil(err)
  23. // t.Equal(expected, string(csv))
  24. }