mardi 19 mars 2019

Golang : Test whether a function was called gomega

I have a function

type ExampleModule struct {
  DB                   *database.Store
  AnotherModule        AnotherModuleInterface
}

func(m *ExampleModule) A (i int, id int[]) error{
  err := m.AnotherModuke.SomeFunc(i, id)
}

How to make a unit test to make sure that the SomeFunc is called when I run the function A? Thank you for your attention.

Aucun commentaire:

Enregistrer un commentaire