INNER CODE UNIT · Go
TestConstants
rameshsunkara/go-rest-api-example · internal/config/config_test.go:58
func TestConstants(t *testing.T) {
// Test that constants are properly defined
assert.Equal(t, "local", config.DefEnvironment)
assert.Equal(t, "8080", config.DefaultPort)
assert.Equal(t, "info", config.DefaultLogLevel)
assert.Equal(t, "ecommerce", config.DefDatabase)
assert.False(t, config.DefDBQueryLogging)
assert.False(t, config.DefEnableTracing)
}
func TestServiceEnvConfigStruct(t *testing.T) {
// Test that we can create the struct
cfg := &config.ServiceEnvConfig{
Environment: "test",
Port: "8080",
LogLevel: "debug",
DBHosts: "localhost:27017",
DBName: "testdb",