using System;

using AIRuntime.Runtime.Agents;

using NUnit.Framework;


namespace AIRuntime.Tests
{
    public sealed class AgentProfileBindingTests
    {
        [Test]
        public void Definition_CreatesDefaultProfile()
        {
            AgentDefinition definition =
                new AgentDefinition(
                    "ArchitectAgent",
                    "Architect",
                    "Architecture agent",
                    "System prompt");


            Assert.IsNotNull(
                definition.Profile);


            Assert.AreEqual(
                "ArchitectAgent",
                definition.Profile.AgentId);
        }



        [Test]
        public void AttachProfile_ReplacesDefaultProfile()
        {
            AgentDefinition definition =
                new AgentDefinition(
                    "DeveloperAgent",
                    "Developer",
                    "",
                    "");


            AgentProfile profile =
                new AgentProfile(
                    "DeveloperAgent");


            profile.Temperature =
                0.8;


            definition.AttachProfile(
                profile);


            Assert.AreSame(
                profile,
                definition.Profile);


            Assert.AreEqual(
                0.8,
                definition.Profile.Temperature);
        }



        [Test]
        public void AttachWrongProfile_Throws()
        {
            AgentDefinition definition =
                new AgentDefinition(
                    "ArchitectAgent",
                    "Architect",
                    "",
                    "");


            AgentProfile profile =
                new AgentProfile(
                    "DeveloperAgent");


            Assert.Throws<InvalidOperationException>(
                () =>
                {
                    definition.AttachProfile(
                        profile);
                });
        }
    }
}