[Camera][TCSACR-136] Added TC for Hue property 80/174380/4
authorHaesu Gwon <haesu.gwon@samsung.com>
Sat, 31 Mar 2018 04:39:41 +0000 (13:39 +0900)
committerHaesu Gwon <haesu.gwon@samsung.com>
Fri, 13 Apr 2018 01:04:27 +0000 (10:04 +0900)
Change-Id: I71bd4f0a1f1ae8f21ae7f613589278fc899d9717
Signed-off-by: Haesu Gwon <haesu.gwon@samsung.com>
tct-suite-vs/Tizen.Camera.Tests/testcase/TSCamera.cs [changed mode: 0755->0644]
tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraCapabilities.cs [changed mode: 0755->0644]
tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraSettings.cs [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 18a8718..b40b594
@@ -19,6 +19,8 @@ namespace Tizen.Multimedia.Tests
     [Description("Tests Tizen.Multimedia.Camera class")]
     public class CameraTests : TestBase
     {
+        private const CameraDevice _invalidDevideNumber = (CameraDevice)10;
+
         [Test]
         [Category("P1")]
         [Description("Test : Camera Constructor for rear camera - Object should not be null after initializing")]
@@ -91,7 +93,7 @@ namespace Tizen.Multimedia.Tests
         [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
         public static void GetDeviceState_THROWS_IF_PARAM_IS_INVALID()
         {
-            Assert.Throws<ArgumentException>(() => Camera.GetDeviceState((CameraDevice)2));
+            Assert.Throws<ArgumentException>(() => Camera.GetDeviceState(_invalidDevideNumber));
         }
 
         [Test]
@@ -144,7 +146,7 @@ namespace Tizen.Multimedia.Tests
         [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
         public static void ChangeDevice_THROWS_IF_PARAM_IS_INVALID()
         {
-            Assert.Throws<ArgumentException>(() => TestCamera.ChangeDevice((CameraDevice)2));
+            Assert.Throws<ArgumentException>(() => TestCamera.ChangeDevice(_invalidDevideNumber));
         }
 
         [Test]
old mode 100755 (executable)
new mode 100644 (file)
index 0059d38..dbb1d47
@@ -200,6 +200,20 @@ namespace Tizen.Multimedia.Tests
 
         [Test]
         [Category("P1")]
+        [Description("Test Hue supported property.")]
+        [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.IsHueSupported A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRO")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public static void IsHueSupported_PROPERTY_READ_ONLY()
+        {
+            var result = TestCamera.Capabilities.IsHueSupported;
+            Assert.IsNotNull(result, "The IsHueSupported value should not be null.");
+            Assert.IsInstanceOf<bool>(result, "The result should be of type boolean.");
+        }
+
+        [Test]
+        [Category("P1")]
         [Description("Test PreviewResolutions supported property. Supported list should be greater than 0")]
         [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.SupportedPreviewResolutions A")]
         [Property("SPEC_URL", "-")]
old mode 100755 (executable)
new mode 100644 (file)
index b29239b..c403b9d
@@ -547,6 +547,28 @@ namespace Tizen.Multimedia.Tests
 
         [Test]
         [Category("P1")]
+        [Description("Test hue range property.")]
+        [Property("SPEC", "Tizen.Multimedia.CameraSettings.HueRange A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRO")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public static void HueRange_PROPERTY_READ_ONLY()
+        {
+            var result = TestCamera.Settings.HueRange;
+
+            if (TestCamera.Capabilities.IsHueSupported)
+            {
+                Assert.IsNotNull(result, "The hue range should not be null.");
+                Assert.IsInstanceOf<Range?>(result, "The hue range should be of Range type.");
+            }
+            else
+            {
+                Assert.IsNull(result, "The hue range should be null because it's not supported.");
+            }
+        }
+
+        [Test]
+        [Category("P1")]
         [Description("Test panrange property.")]
         [Property("SPEC", "Tizen.Multimedia.CameraSettings.PanRange A")]
         [Property("SPEC_URL", "-")]
@@ -730,6 +752,29 @@ namespace Tizen.Multimedia.Tests
 
         [Test]
         [Category("P1")]
+        [Description("Test Hue property.")]
+        [Property("SPEC", "Tizen.Multimedia.CameraSettings.Hue A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRW")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public static void Hue_PROPERTY_READ_WRITE()
+        {
+            if (TestCamera.Capabilities.IsHueSupported)
+            {
+                Range range = TestCamera.Settings.HueRange.Value;
+
+                TestCamera.Settings.Hue = range.Max;
+                Assert.AreNotEqual(0, TestCamera.Settings.Hue, "The hue should not be zero.");
+                Assert.AreEqual(range.Max, TestCamera.Settings.Hue, "The hue value is not same as set value.");
+            }
+            else
+            {
+                Assert.Pass("Hue range feature is not supported.");
+            }
+        }
+
+        [Test]
+        [Category("P1")]
         [Description("Test Whitebalance property.")]
         [Property("SPEC", "Tizen.Multimedia.CameraSettings.WhiteBalance A")]
         [Property("SPEC_URL", "-")]