From 10fdaf4b15da6b248caffa1f2937ffd7e9113af0 Mon Sep 17 00:00:00 2001 From: Haesu Gwon Date: Fri, 17 Jul 2020 16:20:24 +0900 Subject: [PATCH] [AudioIO][TCSACR-336] Add new property to set/get recording volume Change-Id: I122fe407be1120f6eb4f12ddf7f1c853bd6667dd --- .../testcase/AudioIO/TSAudioCaptureBase.cs | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) diff --git a/tct-suite-vs/Tizen.AudioIO.Tests/testcase/AudioIO/TSAudioCaptureBase.cs b/tct-suite-vs/Tizen.AudioIO.Tests/testcase/AudioIO/TSAudioCaptureBase.cs index bfcdde22c..3f09a7211 100644 --- a/tct-suite-vs/Tizen.AudioIO.Tests/testcase/AudioIO/TSAudioCaptureBase.cs +++ b/tct-suite-vs/Tizen.AudioIO.Tests/testcase/AudioIO/TSAudioCaptureBase.cs @@ -282,6 +282,105 @@ namespace Tizen.Multimedia.Tests AssertHelper.PropertyReadOnly(nameof(AudioCaptureBase.SampleType)); } + [Test] + [Category("P1")] + [Description("Check whether Volume property is readable and writeable")] + [Property("SPEC", "Tizen.Multimedia.AudioCaptureBase.Volume A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRW")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Volume_PROPERTY_READ_WRITE() + { + if (_isMicrophoneAvail == false) + return; + + AssertHelper.PropertyReadWrite(nameof(AudioCaptureBase.Volume)); + + using (var audioCapture = new AudioCapture(44100, AudioChannel.Mono, AudioSampleType.S16Le)) + { + Assert.IsInstanceOf(audioCapture.Volume); + + double volume = 1.1; + audioCapture.Volume = volume; + Assert.AreEqual(audioCapture.Volume, volume, "Should be same value."); + } + } + + [Test] + [Category("P1")] + [Description("Check whether Volume property is readable and writeable")] + [Property("SPEC", "Tizen.Multimedia.AudioCaptureBase.Volume A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PDV")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Volume_CHECK_DEFAULT_VALUE() + { + if (_isMicrophoneAvail == false) + return; + + using (var audioCapture = new AudioCapture(44100, AudioChannel.Mono, AudioSampleType.S16Le)) + { + Assert.AreEqual(audioCapture.Volume, 1.0, "Default value of Volume property should be 1.0."); + } + } + + [Test] + [Category("P1")] + [Description("Check Volume property's lower limit.")] + [Property("SPEC", "Tizen.Multimedia.AudioCaptureBase.Volume A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PMIN")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Volume_CHECK_MIN_VALUE() + { + if (_isMicrophoneAvail == false) + return; + + using (var audioCapture = new AudioCapture(44100, AudioChannel.Mono, AudioSampleType.S16Le)) + { + audioCapture.Volume = -1.0; + Assert.AreEqual(audioCapture.Volume, 0.0, "MIN value of Volume property should be 0.0."); + } + } + + [Test] + [Category("P1")] + [Description("Check Volume property's upper limit.")] + [Property("SPEC", "Tizen.Multimedia.AudioCaptureBase.Volume A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PMAX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Volume_CHECK_MAX_VALUE() + { + if (_isMicrophoneAvail == false) + return; + + using (var audioCapture = new AudioCapture(44100, AudioChannel.Mono, AudioSampleType.S16Le)) + { + audioCapture.Volume = 3.0; + Assert.AreEqual(audioCapture.Volume, 2.0, "MAX value of Volume property should be 2.0."); + } + } + + [Test] + [Category("P2")] + [Description("Check whether Volume property throw proper exception.")] + [Property("SPEC", "Tizen.Multimedia.AudioCaptureBase.Volume A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Volume_CHECK_EXCEPTION() + { + if (_isMicrophoneAvail == false) + return; + + var audioCapture = new AudioCapture(44100, AudioChannel.Mono, AudioSampleType.S16Le); + audioCapture.Dispose(); + + Assert.Throws(() => audioCapture.Volume = 1.0, + "Volume property should throw ObjectDisposedException."); + } + [Test] [Category("P1")] [Description("Check whether ApplyStremPolicy can be invoked without exception")] -- 2.34.1