lundi 9 juillet 2018

Clean data after testing

I write tests and in this tests I work with some saved data files, DB records etc.

Should I remove this data before test ends?

For example, I check user finder

func (ID int) User (*User) {
  // my finder here
}

before test I have to create User to DB. So, should I do something like

defer db.Clean()

???

same with files *os.File

Aucun commentaire:

Enregistrer un commentaire