[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")]
[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]
[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]
[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", "-")]
[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", "-")]
[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", "-")]