[AudioIO][TCSACR-336] Add new property to set/get recording volume 72/238772/1
authorHaesu Gwon <haesu.gwon@samsung.com>
Fri, 17 Jul 2020 07:20:24 +0000 (16:20 +0900)
committerHaesu Gwon <haesu.gwon@samsung.com>
Fri, 17 Jul 2020 07:20:24 +0000 (16:20 +0900)
Change-Id: I122fe407be1120f6eb4f12ddf7f1c853bd6667dd

tct-suite-vs/Tizen.AudioIO.Tests/testcase/AudioIO/TSAudioCaptureBase.cs

index bfcdde2..3f09a72 100644 (file)
@@ -284,6 +284,105 @@ namespace Tizen.Multimedia.Tests
 
         [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<AudioCaptureBase>(nameof(AudioCaptureBase.Volume));
+
+            using (var audioCapture = new AudioCapture(44100, AudioChannel.Mono, AudioSampleType.S16Le))
+            {
+                Assert.IsInstanceOf<double>(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<ObjectDisposedException>(() => audioCapture.Volume = 1.0,
+                "Volume property should throw ObjectDisposedException.");
+        }
+
+        [Test]
+        [Category("P1")]
         [Description("Check whether ApplyStremPolicy can be invoked without exception")]
         [Property("SPEC", "Tizen.Multimedia.AudioCaptureBase.ApplyStreamPolicy M")]
         [Property("SPEC_URL", "-")]