From 4c985e7bcab6ad4e9b2eba3be4e7186b3d8f1eba Mon Sep 17 00:00:00 2001 From: routersys Date: Sun, 11 Oct 2026 21:42:09 +0900 Subject: [PATCH] =?UTF-8?q?WPF=E3=82=A2=E3=83=97=E3=83=AA=E3=82=B1?= =?UTF-8?q?=E3=83=BC=E3=82=B7=E3=83=A7=E3=83=B3=E3=81=AE=E5=A4=96=E3=81=A7?= =?UTF-8?q?=E3=81=AE=E6=8C=99=E5=8B=95=E3=81=AE=E8=A9=A6=E9=A8=93=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HostIntegrationTests.cs | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 SpectrumColorShift.Tests/HostIntegrationTests.cs diff --git a/SpectrumColorShift.Tests/HostIntegrationTests.cs b/SpectrumColorShift.Tests/HostIntegrationTests.cs new file mode 100644 index 0000000..ec60328 --- /dev/null +++ b/SpectrumColorShift.Tests/HostIntegrationTests.cs @@ -0,0 +1,30 @@ +using System.Windows; +using Telemetry; + +namespace SpectrumColorShift.Tests; + +public sealed class HostIntegrationTests +{ + [Fact] + public void OutsideAWpfApplicationNoTelemetryIsStartedOrSent() + { + Assert.Null(Application.Current); + + SpectrumColorShiftTelemetry.EnsureStartedOnce(); + SpectrumColorShiftTelemetry.Report(new InvalidOperationException()); + + Assert.Null(ProcessState.Read("DrainClaimed")); + Assert.Null(ProcessState.Read("SentCount")); + } + + [Fact] + public void OutsideAWpfApplicationTheEffectCanStillBeCreated() + { + Assert.Null(Application.Current); + + var effect = new SpectrumColorShiftEffect(); + + Assert.Equal(Texts.SpectrumColorShift, effect.Label); + Assert.Null(ProcessState.Read("DrainClaimed")); + } +}