From f5e37729ab0c4c3b574bfa0437f7174025cf6cb7 Mon Sep 17 00:00:00 2001 From: Jacob Dubin Date: Thu, 14 May 2026 06:48:39 -0500 Subject: [PATCH] Expand legacy Build A routing and emotion replies --- .../WebSockets/JiboInteractionServiceTests.cs | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/OpenJibo/tests/Jibo.Cloud.Tests/WebSockets/JiboInteractionServiceTests.cs b/OpenJibo/tests/Jibo.Cloud.Tests/WebSockets/JiboInteractionServiceTests.cs index ee2e500..355b584 100644 --- a/OpenJibo/tests/Jibo.Cloud.Tests/WebSockets/JiboInteractionServiceTests.cs +++ b/OpenJibo/tests/Jibo.Cloud.Tests/WebSockets/JiboInteractionServiceTests.cs @@ -346,6 +346,33 @@ public sealed class JiboInteractionServiceTests Assert.Equal("EmotionQuery", decision.ContextUpdates![ChitchatRouteKey]); } + [Theory] + [InlineData("joyful", "Yes indeed. Never been better.")] + [InlineData("pleased", "You know it. Life is good.")] + [InlineData("determined", "You're right. I am feeling pretty good at the moment.")] + [InlineData("confident", "All systems are go.")] + [InlineData("insecure", "Yes. Not too shabby.")] + [InlineData("neutral", "All systems are go.")] + public async Task BuildDecisionAsync_EmotionQuery_UsesStateDrivenLegacyReplies( + string emotion, + string expectedReply) + { + var service = CreateService(); + + var decision = await service.BuildDecisionAsync(new TurnContext + { + RawTranscript = "how are you", + NormalizedTranscript = "how are you", + Attributes = new Dictionary + { + [ChitchatEmotionKey] = emotion + } + }); + + Assert.Equal("how_are_you", decision.IntentName); + Assert.Equal(expectedReply, decision.ReplyText); + } + [Fact] public async Task BuildDecisionAsync_Smile_RoutesThroughEmotionCommandSplit() {