12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- package store
- import (
- "git.andreafazzi.eu/andrea/probo/models"
- "github.com/remogatto/prettytest"
- )
- type participantTestSuite struct {
- prettytest.Suite
- }
- func (t *participantTestSuite) TestCreate() {
- store := NewStore[*models.Participant]()
- p_1, err := store.Create(&models.Participant{
- Lastname: "Doe",
- Firstname: "John",
- })
- t.Nil(err)
- p_2, err := store.Create(&models.Participant{
- Lastname: "Doe",
- Firstname: "John",
- Attributes: map[string]string{"class": "1 D LIN"},
- })
- t.Nil(err)
- t.False(p_1.GetHash() == p_2.GetHash())
- }
- func (t *participantTestSuite) TestUpdate() {
- store := NewStore[*models.Participant]()
- p, err := store.Create(&models.Participant{
- Lastname: "Doe",
- Firstname: "John",
- })
- t.Nil(err)
- updatedP, err := store.Update(&models.Participant{
- Lastname: "Doe",
- Firstname: "John",
- Attributes: map[string]string{"class": "1 D LIN"},
- }, p.ID)
- t.Nil(err)
- t.False(p.GetHash() == updatedP.GetHash())
- }
|