Пример #1
0
 public void GetAudioSettings_SetEverything_TriggersSPlusDelegatesCorrectly()
 {
     TestHttpClient.ResponseContents =
         @"{""status"":""success"",""audioInfo"":{ ""audiosel"":""local"",""mute"":true,""volume"":10,""tune mode"":""equalizer"",""presets"":""classical"",""band0"":-11.75,""band1"":-8,""band2"":-2,""band3"":0,""band4"":5,""basstone"":12,""treble"":-10,""surround"":true,""surrlevel"":3,""basslevel"":31,""bass"":true,""bassfreq"":175,""highpass"":true}}";
     using (new AssertionScope()) {
         sw41.AudioSettingsApi.Poll();
         LocalAudioF.Should().Be(1);
         MuteF.Should().Be(1);
         VolumeF.Should().Be(6553);
         TuneModeEqualizerF.Should().Be(1);
         PresetClassicalF.Should().Be(1);
         Band115F.Should().Be(-117);
         Band330F.Should().Be(-80);
         Band990F.Should().Be(-20);
         Band3000F.Should().Be(0);
         Band9900F.Should().Be(50);
         BassF.Should().Be(120);
         TrebleF.Should().Be(-100);
         SurroundF.Should().Be(1);
         SurroundLevelF.Should().Be(28086);
         BassLevelF.Should().Be(15996);
         BassEnhancementF.Should().Be(1);
         BassCutFreq175F.Should().Be(1);
         HighPassF.Should().Be(1);
     }
 }
Пример #2
0
        public void PollAudioSettings_TuneMode_TriggersSPlusDelegatesCorrectly(string value, int v1, int v2, int v3, int v4)
        {
            var responseText = string.Format(@"{{""status"": ""success"", ""audioInfo"": {{""audiosel"": ""local"", ""mute"": false, ""volume"": 0, ""tune mode"": ""{0}"", ""presets"": ""acoustic"", ""band0"": 0.0, ""band1"": 0.0, ""band2"": 0.0, ""band3"": 0.0, ""band4"": 0.0, ""basstone"": 0.0, ""treble"": 0.0, ""surround"": false, ""surrlevel"": 0, ""basslevel"": 0, ""bass"": false, ""bassfreq"": 0, ""highpass"": false}}}}", value);

            TestHttpClient.ResponseContents = responseText;
            sw41.AudioSettingsApi.Poll();
            ErrorMessage.LastErrorMessage.Should().BeNullOrEmpty();
            TuneModeDisabledF.Should().Be((ushort)v1);
            TuneModePresetsF.Should().Be((ushort)v2);
            TuneModeEqualizerF.Should().Be((ushort)v3);
            TuneModeToneControlF.Should().Be((ushort)v4);
        }