load_config_test.go 569 B

12345678910111213141516171819202122232425262728293031
  1. package config
  2. import "testing"
  3. func TestInitialize(t *testing.T) {
  4. type args struct {
  5. path string
  6. cfgStruct interface{}
  7. }
  8. tests := []struct {
  9. name string
  10. args args
  11. wantErr bool
  12. }{
  13. {
  14. name: "AppName",
  15. args: args{
  16. path: "app.test.yaml",
  17. cfgStruct: nil,
  18. },
  19. wantErr: false,
  20. },
  21. }
  22. for _, tt := range tests {
  23. t.Run(tt.name, func(t *testing.T) {
  24. if err := Initialize(tt.args.path, tt.args.cfgStruct); (err != nil) != tt.wantErr {
  25. t.Errorf("Initialize() error = %v, wantErr %v", err, tt.wantErr)
  26. }
  27. })
  28. }
  29. }