diff --git a/container/container_test.go b/container/container_test.go new file mode 100644 index 0000000..6f1af4d --- /dev/null +++ b/container/container_test.go @@ -0,0 +1,30 @@ +package container + +import ( + "os" + "testing" + + "goweb/config" + + "github.com/stretchr/testify/assert" +) + +func TestMain(m *testing.M) { + // Set the environment to test + config.SwitchEnvironment(config.EnvTest) + + // Run tests + exitVal := m.Run() + os.Exit(exitVal) +} + +func TestNewContainer(t *testing.T) { + c := NewContainer() + assert.NotNil(t, c.Web) + assert.NotNil(t, c.Config) + assert.NotNil(t, c.Cache) + assert.NotNil(t, c.Database) + assert.NotNil(t, c.ORM) + assert.NotNil(t, c.Mail) + assert.NotNil(t, c.Auth) +}