85 lines
1.9 KiB
Plaintext
Executable File
85 lines
1.9 KiB
Plaintext
Executable File
using Agentic.Engine;
|
|
|
|
namespace MarketAlly.AIPlugin.Tests;
|
|
|
|
/// <summary>
|
|
/// Tests for AgenticEngineBuilder
|
|
/// </summary>
|
|
public class AgenticEngineBuilderTests
|
|
{
|
|
[Fact]
|
|
public void Build_WithoutConfiguration_ShouldCreateValidEngine()
|
|
{
|
|
// Arrange
|
|
var builder = new AgenticEngineBuilder();
|
|
|
|
// Act
|
|
var engine = builder.Build();
|
|
|
|
// Assert
|
|
engine.Should().NotBeNull();
|
|
engine.IsRunning.Should().BeFalse();
|
|
}
|
|
|
|
[Fact]
|
|
public void Build_MultipleTimes_ShouldCreateIndependentInstances()
|
|
{
|
|
// Arrange
|
|
var builder = new AgenticEngineBuilder();
|
|
|
|
// Act
|
|
var engine1 = builder.Build();
|
|
var engine2 = builder.Build();
|
|
|
|
// Assert
|
|
engine1.Should().NotBeNull();
|
|
engine2.Should().NotBeNull();
|
|
engine1.Should().NotBeSameAs(engine2);
|
|
}
|
|
|
|
[Fact]
|
|
public void WithWorkspacePath_ShouldAcceptValidPath()
|
|
{
|
|
// Arrange
|
|
var builder = new AgenticEngineBuilder();
|
|
var testPath = Path.GetTempPath();
|
|
|
|
// Act
|
|
var result = builder.WithWorkspacePath(testPath);
|
|
|
|
// Assert
|
|
result.Should().BeSameAs(builder); // Fluent interface
|
|
}
|
|
|
|
[Theory]
|
|
[InlineData("")]
|
|
[InlineData(null)]
|
|
public void WithWorkspacePath_WithInvalidPath_ShouldThrow(string invalidPath)
|
|
{
|
|
// Arrange
|
|
var builder = new AgenticEngineBuilder();
|
|
|
|
// Act
|
|
Action act = () => builder.WithWorkspacePath(invalidPath);
|
|
|
|
// Assert
|
|
act.Should().Throw<ArgumentException>();
|
|
}
|
|
|
|
[Fact]
|
|
public void Build_AfterMultipleConfigurations_ShouldApplyAllSettings()
|
|
{
|
|
// Arrange
|
|
var builder = new AgenticEngineBuilder();
|
|
var testPath = Path.GetTempPath();
|
|
|
|
// Act
|
|
var engine = builder
|
|
.WithWorkspacePath(testPath)
|
|
.Build();
|
|
|
|
// Assert
|
|
engine.Should().NotBeNull();
|
|
}
|
|
}
|