// Code generated by mdatagen. DO NOT EDIT.

package configretry

import (
	"testing"

	"github.com/stretchr/testify/require"
)

func TestBackOffConfigValidate_DefaultValid(t *testing.T) {
	cfg := NewDefaultBackOffConfig()

	require.NoError(t, cfg.Validate())
}

func TestBackOffConfigValidate_MinimumInitialInterval(t *testing.T) {
	cfg := NewDefaultBackOffConfig()
	cfg.InitialInterval = 0 - 1

	require.ErrorContains(t, cfg.Validate(), "initial_interval value must be greater than or equal to 0")
}

func TestBackOffConfigValidate_MinimumMaxElapsedTime(t *testing.T) {
	cfg := NewDefaultBackOffConfig()
	cfg.MaxElapsedTime = 0 - 1

	require.ErrorContains(t, cfg.Validate(), "max_elapsed_time value must be greater than or equal to 0")
}

func TestBackOffConfigValidate_MinimumMaxInterval(t *testing.T) {
	cfg := NewDefaultBackOffConfig()
	cfg.MaxInterval = 0 - 1

	require.ErrorContains(t, cfg.Validate(), "max_interval value must be greater than or equal to 0")
}

func TestBackOffConfigValidate_MinimumMultiplier(t *testing.T) {
	cfg := NewDefaultBackOffConfig()
	cfg.Multiplier = 0 - 1

	require.ErrorContains(t, cfg.Validate(), "multiplier value must be greater than or equal to 0")
}

func TestBackOffConfigValidate_MinimumRandomizationFactor(t *testing.T) {
	cfg := NewDefaultBackOffConfig()
	cfg.RandomizationFactor = 0 - 1

	require.ErrorContains(t, cfg.Validate(), "randomization_factor value must be greater than or equal to 0")
}

func TestBackOffConfigValidate_MaximumRandomizationFactor(t *testing.T) {
	cfg := NewDefaultBackOffConfig()
	cfg.RandomizationFactor = 1 + 1

	require.ErrorContains(t, cfg.Validate(), "randomization_factor value must be less than or equal to 1")
}
