Skip to content

Commit

Permalink
Adds testing
Browse files Browse the repository at this point in the history
  • Loading branch information
tjayrush committed Jan 23, 2025
1 parent b544cf9 commit a5eee4b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pkg/types/general_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,17 @@ detail: "entireIndex"
assert.Contains(t, errStr, "invalid characters", "Expected dataFolder validation to fail due to invalid characters")
assert.Contains(t, errStr, "invalid_strategy", "Expected strategy validation to fail")
}

func TestNewGeneralValidation(t *testing.T) {
// Create a new instance of General using NewGeneral
g := NewGeneral()

// Validate the defaults
err := validate.Validate(&g)
assert.NoError(t, err, "Expected NewGeneral defaults to pass validation")

// Assert specific defaults
assert.NotEmpty(t, g.DataFolder, "DataFolder should not be empty")
assert.Equal(t, "download", g.Strategy, "Default Strategy should be 'download'")
assert.Equal(t, "entireIndex", g.Detail, "Default Detail should be 'entireIndex'")
}

0 comments on commit a5eee4b

Please sign in to comment.