Added a SWOT analysis assistant (#1122)

Co-authored-by: hart_s3 <sabrina.hartmann@dlr.de>
This commit is contained in:
Thorsten Sommerandhart_s3 authored and GitHub committed 2026-10-28 08:51:30 +01:00
1 parent 6cb20fd75a
commit 060a2a5734
87 files changed
+4601 -45

No files matched your search

@@ -0,0 +1,40 @@
using System.Text.Json;
using AIStudio.Chat;
namespace AIStudio.Tests.Chat;
[TestFixture]
public sealed class ContentPresentationTests
{
[Test]
public void TheDataHashCodeFollowsNewData()
{
var presentation = ContentPresentation.Create(ContentPresentationKind.SWOT_ANALYSIS, new { heading = "First" });
var firstHashCode = presentation.GetDataHashCode();
presentation.Data = JsonSerializer.SerializeToElement(new { heading = "Second" });
Assert.Multiple(() =>
{
Assert.That(firstHashCode, Is.Not.Zero);
Assert.That(presentation.GetDataHashCode(), Is.Not.EqualTo(firstHashCode));
});
}
[Test]
public void APresentationWithoutDataHasTheHashCodeZero()
{
var presentation = new ContentPresentation { Kind = ContentPresentationKind.SWOT_ANALYSIS };
Assert.That(presentation.GetDataHashCode(), Is.Zero);
}
[Test]
public void ACloneHasTheSameDataHashCode()
{
var presentation = ContentPresentation.Create(ContentPresentationKind.SWOT_ANALYSIS, new { heading = "First" });
Assert.That(presentation.DeepClone().GetDataHashCode(), Is.EqualTo(presentation.GetDataHashCode()));
}
}