From 5bce7e9a49a9efba0765783d35e8515eccfa0ad5 Mon Sep 17 00:00:00 2001 From: Ephemerality Date: Mon, 20 Dec 2021 13:12:50 -0400 Subject: [PATCH] add build check to test --- SoundSwitch.Audio.Manager.Tests/AudioPolicyConfigTests.cs | 4 ++-- .../Client/Extended/Factory/AudioPolicyConfigFactory.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/SoundSwitch.Audio.Manager.Tests/AudioPolicyConfigTests.cs b/SoundSwitch.Audio.Manager.Tests/AudioPolicyConfigTests.cs index d994d3b508..460c406896 100644 --- a/SoundSwitch.Audio.Manager.Tests/AudioPolicyConfigTests.cs +++ b/SoundSwitch.Audio.Manager.Tests/AudioPolicyConfigTests.cs @@ -21,8 +21,8 @@ public void CreateAudioPolicyConfigTest() public void UnsupportedWindowsVersionTest() { var audioPolicyConfig = AudioPolicyConfigFactory.Create(); - if (Environment.OSVersion.Version.Major < 10) - Assert.True(audioPolicyConfig is UnsupportedAudioPolicyConfig, $"audioPolicyConfig should be {nameof(UnsupportedAudioPolicyConfig)} if not on Windows 10+"); + if (Environment.OSVersion.Version.Major < 10 || Environment.OSVersion.Version.Build <= AudioPolicyConfigFactory.OS_1709_VERSION) + Assert.True(audioPolicyConfig is UnsupportedAudioPolicyConfig, $"audioPolicyConfig should be {nameof(UnsupportedAudioPolicyConfig)} if not on Windows 10 versions above 1709"); else Assert.True(audioPolicyConfig is AudioPolicyConfig, $"audioPolicyConfig should be a valid {nameof(AudioPolicyConfig)}"); } diff --git a/SoundSwitch.Audio.Manager/Interop/Client/Extended/Factory/AudioPolicyConfigFactory.cs b/SoundSwitch.Audio.Manager/Interop/Client/Extended/Factory/AudioPolicyConfigFactory.cs index ba01a51877..4a43ab7c78 100644 --- a/SoundSwitch.Audio.Manager/Interop/Client/Extended/Factory/AudioPolicyConfigFactory.cs +++ b/SoundSwitch.Audio.Manager/Interop/Client/Extended/Factory/AudioPolicyConfigFactory.cs @@ -6,7 +6,7 @@ namespace SoundSwitch.Audio.Manager.Interop.Client.Extended.Factory { internal static class AudioPolicyConfigFactory { - private const int OS_1709_VERSION = 16299; + internal const int OS_1709_VERSION = 16299; public static IAudioPolicyConfig Create() {