diff --git a/InkDispersion.Tests/HostIntegrationTests.cs b/InkDispersion.Tests/HostIntegrationTests.cs new file mode 100644 index 0000000..8ccb253 --- /dev/null +++ b/InkDispersion.Tests/HostIntegrationTests.cs @@ -0,0 +1,30 @@ +using System.Windows; +using Telemetry; + +namespace InkDispersion.Tests; + +public sealed class HostIntegrationTests +{ + [Fact] + public void OutsideAWpfApplicationNoTelemetryIsStartedOrSent() + { + Assert.Null(Application.Current); + + InkDispersionTelemetry.EnsureStartedOnce(); + InkDispersionTelemetry.Report(new InvalidOperationException()); + + Assert.Null(ProcessState.Read("DrainClaimed")); + Assert.Null(ProcessState.Read("SentCount")); + } + + [Fact] + public void OutsideAWpfApplicationTheEffectCanStillBeCreated() + { + Assert.Null(Application.Current); + + var effect = new InkDispersionEffect(); + + Assert.Equal(Texts.InkDispersion, effect.Label); + Assert.Null(ProcessState.Read("DrainClaimed")); + } +}