mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
* Fixed project build in Visual Studio * Added Agent abstractions * Remove features we are not porting over, addressing PR comments and making updates as per agreed design. * Add create thread method. * Add unit tests and update invoke response type to async * Address PR comments and fix formatting. * Switch to shared null checker to fix build failures. * Add additional tests to increase code coverage * Seal mockagent * Fix line coverage failure * Improve coverage check formatting --------- Co-authored-by: westey <164392973+westey-m@users.noreply.github.com>
38 lines
983 B
C#
38 lines
983 B
C#
// Copyright (c) Microsoft. All rights reserved.
|
|
|
|
using System;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Microsoft.Agents.Abstractions.UnitTests;
|
|
|
|
/// <summary>
|
|
/// Unit tests for the <see cref="AgentRunOptions"/> class.
|
|
/// </summary>
|
|
public class AgentRunOptionsTests
|
|
{
|
|
[Fact]
|
|
public void CloningConstructorCopiesProperties()
|
|
{
|
|
// Arrange
|
|
var options = new AgentRunOptions
|
|
{
|
|
AdditionalInstructions = "Test instructions",
|
|
OnIntermediateMessage = msg => Task.CompletedTask
|
|
};
|
|
|
|
// Act
|
|
var clone = new AgentRunOptions(options);
|
|
|
|
// Assert
|
|
Assert.Equal(options.AdditionalInstructions, clone.AdditionalInstructions);
|
|
Assert.Equal(options.OnIntermediateMessage, clone.OnIntermediateMessage);
|
|
}
|
|
|
|
[Fact]
|
|
public void CloningConstructorThrowsIfNull()
|
|
{
|
|
// Act & Assert
|
|
Assert.Throws<ArgumentNullException>(() => new AgentRunOptions(null!));
|
|
}
|
|
}
|