package config

import (
	"testing"

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

func TestGetDeploymentType(t *testing.T) {
	// Test k8s app
	k8sConfig := &EdgeConnectConfig{
		Spec: Spec{
			K8sApp: &K8sApp{},
		},
	}
	assert.Equal(t, "kubernetes", k8sConfig.GetDeploymentType())

	// Test docker app
	dockerConfig := &EdgeConnectConfig{
		Spec: Spec{
			DockerApp: &DockerApp{},
		},
	}
	assert.Equal(t, "docker", dockerConfig.GetDeploymentType())
}

func TestGetImagePath(t *testing.T) {

	// Test docker app with image
	dockerConfig := &EdgeConnectConfig{
		Spec: Spec{
			DockerApp: &DockerApp{
				Image: "my-custom-image:latest",
			},
		},
	}
	assert.Equal(t, "my-custom-image:latest", dockerConfig.GetImagePath())

	// Test k8s app (should use default)
	k8sConfig := &EdgeConnectConfig{
		Spec: Spec{
			K8sApp: &K8sApp{},
		},
	}
	assert.Equal(t, "https://registry-1.docker.io/library/nginx:latest", k8sConfig.GetImagePath())
}
