Skip to content

Commit

Permalink
[C#] feat: add SequenceAugmentation unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
swatDong committed Jan 10, 2024
1 parent e3125dd commit 78acb8d
Showing 1 changed file with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@ namespace Microsoft.Teams.AI.Tests.AITests.Augmentations
{
public class SequenceAugmentationTests
{
[Fact]
public void Test_CreatePromptSection_NotNull()
{
// Arrange
SequenceAugmentation augmentation = new(new());

// Act
var section = augmentation.CreatePromptSection();

// Assert
Assert.NotNull(section);
}

[Fact]
public async Task Test_CreatePlanFromResponseAsync_ValidPlan_ShouldSucceed()
{
Expand Down Expand Up @@ -52,6 +65,25 @@ public async Task Test_CreatePlanFromResponseAsync_ValidPlan_ShouldSucceed()
Assert.Equal("hello", (plan.Commands[1] as PredictedSayCommand)?.Response);
}

[Fact]
public async Task Test_CreatePlanFromResponseAsync_EmptyResponse_ReturnsNull()
{
// Arrange
Mock<ITurnContext> context = new();
MemoryFork memory = new();
SequenceAugmentation augmentation = new(new());
PromptResponse promptResponse = new()
{
Status = PromptResponseStatus.Success
};

// Act
var plan = await augmentation.CreatePlanFromResponseAsync(context.Object, memory, promptResponse);

// Assert
Assert.Null(plan);
}

[Fact]
public async Task Test_CreatePlanFromResponseAsync_InvalidContent_ReturnsNull()
{
Expand Down

0 comments on commit 78acb8d

Please sign in to comment.