package schema

import (
	"testing"

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

func TestProtocolVersion(t *testing.T) {
	assert := assert.New(t)
	assert.Equal(1, ProtocolVersion(1))
}

func TestAgentMethods(t *testing.T) {
	assert := assert.New(t)
	assert.Equal("initialize", MethodInitialize)
	assert.Equal("authenticate", MethodAuthenticate)
	assert.Equal("session/new", MethodSessionNew)
	assert.Equal("session/load", MethodSessionLoad)
	assert.Equal("session/list", MethodSessionList)
	assert.Equal("session/prompt", MethodSessionPrompt)
	assert.Equal("session/cancel", MethodSessionCancel)
	assert.Equal("session/set_mode", MethodSessionSet_mode)
	assert.Equal("session/set_config_option", MethodSessionSet_config_option)

	assert.Equal(9, len(AgentMethods))
	for name, method := range AgentMethods {
		assert.NotEmpty(name)
		assert.NotEmpty(method)
	}
}

func TestClientMethods(t *testing.T) {
	assert := assert.New(t)
	assert.Equal("session/update", MethodSessionUpdate)
	assert.Equal("session/request_permission", MethodSessionRequest_permission)
	assert.Equal("fs/read_text_file", MethodFsRead_text_file)
	assert.Equal("fs/write_text_file", MethodFsWrite_text_file)
	assert.Equal("terminal/create", MethodTerminalCreate)
	assert.Equal("terminal/output", MethodTerminalOutput)
	assert.Equal("terminal/release", MethodTerminalRelease)
	assert.Equal("terminal/wait_for_exit", MethodTerminalWait_for_exit)
	assert.Equal("terminal/kill", MethodTerminalKill)

	assert.Equal(9, len(ClientMethods))
	for name, method := range ClientMethods {
		assert.NotEmpty(name)
		assert.NotEmpty(method)
	}
}
