mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-16 19:48:27 +00:00
Added the value card sort to the BeyondFacts Lab (#1206)
This commit is contained in:
1 parent
1361b984eb
commit
3ca4b3878b
42 files changed
+2111
-114
No files matched your search
@@ -1,3 +1,6 @@
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
using AIStudio.Assistants.BeyondFactsLab;
|
||||
|
||||
namespace AIStudio.Tests.BeyondFactsLab;
|
||||
@@ -167,6 +170,62 @@ public sealed class BflStalenessTests
|
||||
Assert.That(BflStaleness.FingerprintOf(first), Is.Not.EqualTo(BflStaleness.FingerprintOf(second)));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void WithoutACardSortTheFingerprintStaysAsItWasBeforeTheCardSort()
|
||||
{
|
||||
var withoutCardSort = new BflStepFormData();
|
||||
withoutCardSort.Set(BflFieldCatalog.VALUES_AND_CONCERNS, "Text");
|
||||
var withEmptyCardSort = new BflStepFormData { CardSort = new() };
|
||||
withEmptyCardSort.Set(BflFieldCatalog.VALUES_AND_CONCERNS, "Text");
|
||||
|
||||
// How the lab computed the fingerprint of this form before it had a card sort:
|
||||
var before = Convert.ToHexStringLower(SHA256.HashData(Encoding.UTF8.GetBytes($"{BflFieldCatalog.VALUES_AND_CONCERNS}\0Text\0")));
|
||||
|
||||
using (Assert.EnterMultipleScope())
|
||||
{
|
||||
Assert.That(BflStaleness.FingerprintOf(withoutCardSort), Is.EqualTo(before));
|
||||
Assert.That(BflStaleness.FingerprintOf(withEmptyCardSort), Is.EqualTo(before));
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TheFingerprintCountsTheCardSort()
|
||||
{
|
||||
var empty = new BflStepFormData();
|
||||
var sorted = new BflStepFormData { CardSort = new() };
|
||||
sorted.CardSort.Sort("honesty", BflValueCategory.ESPECIALLY_IMPORTANT);
|
||||
var sortedOtherwise = new BflStepFormData { CardSort = new() };
|
||||
sortedOtherwise.CardSort.Sort("honesty", BflValueCategory.UNCLEAR);
|
||||
var withOwnValue = new BflStepFormData { CardSort = new() };
|
||||
withOwnValue.CardSort.AddOwnValue("Curiosity", string.Empty);
|
||||
|
||||
var fingerprints = new[] { empty, sorted, sortedOtherwise, withOwnValue }.Select(BflStaleness.FingerprintOf).ToList();
|
||||
|
||||
Assert.That(fingerprints, Is.Unique);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TheOrderOfTheValuesToLookAtMoreCloselyIsNoChange()
|
||||
{
|
||||
var first = new BflStepFormData { CardSort = new() { Focus = ["honesty", "openness"] } };
|
||||
var second = new BflStepFormData { CardSort = new() { Focus = ["openness", "honesty"] } };
|
||||
|
||||
Assert.That(BflStaleness.FingerprintOf(first), Is.EqualTo(BflStaleness.FingerprintOf(second)));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void AChangedCardSortWeighsLikeChangedDetails()
|
||||
{
|
||||
var form = new BflStepFormData();
|
||||
var workStates = new Dictionary<BflStep, BflWorkState>();
|
||||
Confirm(workStates, BflStep.VALUES_AND_PERSPECTIVES, form);
|
||||
|
||||
form.CardSort = new();
|
||||
form.CardSort.Sort("openness", BflValueCategory.ALSO_IMPORTANT);
|
||||
|
||||
Assert.That(BflStaleness.Of(BflStep.VALUES_AND_PERSPECTIVES, workStates, Forms((BflStep.VALUES_AND_PERSPECTIVES, form))), Is.EqualTo(BflWorkStateStatus.DETAILS_CHANGED));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void AConfirmationRemembersOnlyEarlierSteps()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user