Upgraded to .NET 10 (#1147)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-11-01 20:32:16 +01:00
1 parent faae2951f7
commit fc7399e81b
327 files changed
+3059 -3049

No files matched your search

@@ -19,12 +19,12 @@ public sealed class AssistantLaunchServiceTests
{
var destinations = AssistantLaunchService.SelectDestinations(AIStudio.Tools.Components.TRANSLATION_ASSISTANT, _ => true);
Assert.Multiple(() =>
using (Assert.EnterMultipleScope())
{
Assert.That(destinations, Does.Not.Contain(AIStudio.Tools.Components.TRANSLATION_ASSISTANT));
Assert.That(destinations, Does.Contain(AIStudio.Tools.Components.SLIDE_BUILDER_ASSISTANT));
Assert.That(destinations, Does.Contain(AIStudio.Tools.Components.CHAT));
});
}
}
[Test]
@@ -39,13 +39,13 @@ public sealed class AssistantLaunchServiceTests
{
var destinations = AssistantLaunchService.SelectDestinations(AIStudio.Tools.Components.CHAT, _ => true);
Assert.Multiple(() =>
using (Assert.EnterMultipleScope())
{
Assert.That(destinations, Is.Not.Empty);
Assert.That(destinations.All(destination => destination.AllowSendTo()), Is.True);
Assert.That(destinations, Does.Not.Contain(AIStudio.Tools.Components.DYNAMIC_ASSISTANT), "Assistant plugins cannot take content yet.");
Assert.That(destinations, Does.Not.Contain(AIStudio.Tools.Components.NONE));
});
}
}
[Test]
@@ -62,13 +62,13 @@ public sealed class ChatMessagePayloadTests
var payload = await this.launchService.CreateTextPayloadAsync(chat, answer);
Assert.That(payload, Is.Not.Null);
Assert.Multiple(() =>
using (Assert.EnterMultipleScope())
{
Assert.That(payload!.Text, Does.Not.Contain(SUSPICIOUS_PASSAGE), "The suspicious passage would reach the next model.");
Assert.That(payload.Text, Does.Contain("The report:").And.Contain(FakeRuntime.REDACTION_MARKER));
Assert.That(payload.Restrictions.WebAddressesWrittenByModels, Is.EquivalentTo(new[] { WebAddresses.CreateRequestKey(new Uri("https://example.org/report")) }), "The AI wrote the address, so it never counts as given by the user.");
Assert.That(this.collector.Alerts, Is.EqualTo(new[] { new[] { this.chatName } }), "The user should hear once, naming the chat.");
});
}
}
[Test]
@@ -81,12 +81,12 @@ public sealed class ChatMessagePayloadTests
var payload = await this.launchService.CreateTextPayloadAsync(chat, message);
Assert.That(payload, Is.Not.Null);
Assert.Multiple(() =>
using (Assert.EnterMultipleScope())
{
Assert.That(this.runtime.FilteredTexts, Is.Empty, "The user wrote the message, which is theirs to send.");
Assert.That(payload!.Text, Is.EqualTo(text));
Assert.That(payload.Restrictions.WebAddressesWrittenByModels, Is.Empty, "The user wrote the address.");
});
}
}
[Test]
@@ -101,11 +101,11 @@ public sealed class ChatMessagePayloadTests
var payload = await this.launchService.CreateTextPayloadAsync(chat, message);
Assert.That(payload, Is.Not.Null);
Assert.Multiple(() =>
using (Assert.EnterMultipleScope())
{
Assert.That(payload!.Restrictions.ProviderConfidence, Is.EqualTo(ConfidenceLevel.HIGH));
Assert.That(payload.Restrictions.OutboundData.Origin, Is.EqualTo(OutboundDataOrigin.MAILBOX), "A message written before the chat read the mailbox demands what the chat demands since, which is the safe side.");
});
}
}
[Test]
@@ -120,12 +120,12 @@ public sealed class ChatMessagePayloadTests
var forSystemMessage = await this.launchService.CreateTextPayloadAsync(chat, systemMessage);
var forForeignContent = await this.launchService.CreateTextPayloadAsync(chat, foreignContent);
Assert.Multiple(() =>
using (Assert.EnterMultipleScope())
{
Assert.That(forEmptyAnswer, Is.Null, "There is nothing to send.");
Assert.That(forSystemMessage, Is.Null, "Only messages of the user and of the AI offer sending.");
Assert.That(forForeignContent, Is.Null, "The content belongs to no message of the chat.");
});
}
}
[Test]
@@ -61,13 +61,13 @@ public sealed class TextPayloadFilterTests
{
var payload = await this.launchService.CreateTextPayloadAsync($"Here is the report. {SUSPICIOUS_PASSAGE} That is all.", writtenByModel: true, ChatRestrictions.NONE, this.sourceName);
Assert.Multiple(() =>
using (Assert.EnterMultipleScope())
{
Assert.That(this.runtime.FilteredTexts, Has.Count.EqualTo(1), "The answer did not go through the filter.");
Assert.That(payload.Text, Does.Not.Contain(SUSPICIOUS_PASSAGE), "The suspicious passage would reach the next model.");
Assert.That(payload.Text, Does.Contain("Here is the report.").And.Contain(FakeRuntime.REDACTION_MARKER), "The rest of the answer got lost.");
Assert.That(this.collector.Alerts, Is.EqualTo(new[] { new[] { this.sourceName } }), "The user should hear once, naming where the answer came from.");
});
}
}
[Test]
@@ -78,12 +78,12 @@ public sealed class TextPayloadFilterTests
var payload = await this.launchService.CreateTextPayloadAsync(text, writtenByModel: false, restrictions, this.sourceName);
Assert.Multiple(() =>
using (Assert.EnterMultipleScope())
{
Assert.That(this.runtime.FilteredTexts, Is.Empty, "The user wrote the text, which is theirs to send.");
Assert.That(payload.Text, Is.EqualTo(text));
Assert.That(payload.Restrictions, Is.SameAs(restrictions), "The text keeps the restrictions of its chat, and the addresses the user wrote count as given.");
});
}
}
[Test]
@@ -93,13 +93,13 @@ public sealed class TextPayloadFilterTests
var payload = await this.launchService.CreateTextPayloadAsync("The minutes are on https://example.org/minutes.", writtenByModel: true, restrictions, this.sourceName);
Assert.Multiple(() =>
using (Assert.EnterMultipleScope())
{
Assert.That(payload.Restrictions.ProviderConfidence, Is.EqualTo(ConfidenceLevel.HIGH));
Assert.That(payload.Restrictions.DataSecurity, Is.EqualTo(DataSourceSecurity.SELF_HOSTED));
Assert.That(payload.Restrictions.OutboundData, Is.EqualTo(restrictions.OutboundData));
Assert.That(payload.Restrictions.WebAddressesWrittenByModels, Is.EquivalentTo(new[] { WebAddresses.CreateRequestKey(new Uri("https://example.org/minutes")) }));
});
}
}
[Test]