From 8caeeb15eb17c97d071c76fda08d80d89efb8447 Mon Sep 17 00:00:00 2001 From: Haesu Gwon Date: Sat, 22 Aug 2020 16:27:11 +0900 Subject: [PATCH] [Camera][Non-ACR] Add new negative TCs Change-Id: I9fba1378ff4cd90a5c4665cd9fbd54aa21eb4311 --- .../Tizen.Camera.Tests/testcase/TSCamera.cs | 774 +++++++++++++++++++-- .../testcase/TSCameraCapabilities.cs | 317 ++++++++- .../testcase/TSCameraCapturingEventArgs.cs | 50 +- .../TSCameraDeviceStateChangedEventArgs.cs | 11 +- .../testcase/TSCameraDisplaySettings.cs | 270 +++++++ .../testcase/TSCameraSettings.cs | 739 +++++++++++++++++++- .../testcase/TSCameraStateChangedEventArgs.cs | 39 +- .../testcase/TSHdrCaptureProgressEventArgs.cs | 18 +- .../testcase/TSMediaPacketPreviewEventArgs.cs | 13 +- .../Tizen.Camera.Tests/testcase/TSStillImage.cs | 90 ++- .../Tizen.Camera.UI.Tests/testcase/TSCamera.cs | 47 ++ 11 files changed, 2241 insertions(+), 127 deletions(-) mode change 100755 => 100644 tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraCapabilities.cs mode change 100755 => 100644 tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraCapturingEventArgs.cs mode change 100755 => 100644 tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraDeviceStateChangedEventArgs.cs mode change 100755 => 100644 tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraDisplaySettings.cs mode change 100755 => 100644 tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraStateChangedEventArgs.cs mode change 100755 => 100644 tct-suite-vs/Tizen.Camera.Tests/testcase/TSHdrCaptureProgressEventArgs.cs mode change 100755 => 100644 tct-suite-vs/Tizen.Camera.Tests/testcase/TSMediaPacketPreviewEventArgs.cs mode change 100755 => 100644 tct-suite-vs/Tizen.Camera.Tests/testcase/TSStillImage.cs diff --git a/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCamera.cs b/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCamera.cs index 325e2b3..72e5163 100644 --- a/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCamera.cs +++ b/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCamera.cs @@ -56,6 +56,32 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Constructor throws ArgumentException if device paramerter is invalid.")] + [Property("SPEC", " Tizen.Multimedia.Camera.Camera C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Camera_THROWS_IF_PARAM_IS_INVALID_UPPER() + { + Assert.Throws(() => new Camera((CameraDevice)(CameraDevice.CameraDevice9 + 2)), + "Should throws proper exception"); + } + + [Test] + [Category("P2")] + [Description("Constructor throws ArgumentException if device paramerter is invalid.")] + [Property("SPEC", " Tizen.Multimedia.Camera.Camera C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Camera_THROWS_IF_PARAM_IS_INVALID_LOWER() + { + Assert.Throws(() => new Camera((CameraDevice)(CameraDevice.CameraDevice0 - 2)), + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test GetDeviceState method for each specific state.")] [Property("SPEC", "Tizen.Multimedia.Camera.GetDeviceState M")] @@ -81,12 +107,19 @@ namespace Tizen.Multimedia.Tests { TestCamera.StateChanged += eventWaiter; - TestCamera.StartPreview(); + try + { + TestCamera.StartPreview(); - await eventWaiter.IsRaisedAsync(); + await eventWaiter.IsRaisedAsync(); - // Check Working State. - Assert.That(Camera.GetDeviceState(CameraDevice.Rear), Is.EqualTo(CameraDeviceState.Working)); + // Check Working State. + Assert.That(Camera.GetDeviceState(CameraDevice.Rear), Is.EqualTo(CameraDeviceState.Working)); + } + finally + { + TestCamera.StateChanged -= eventWaiter; + } } } @@ -99,7 +132,8 @@ namespace Tizen.Multimedia.Tests [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] public void GetDeviceState_THROWS_IF_PARAM_IS_INVALID() { - Assert.Throws(() => Camera.GetDeviceState(_invalidDevideNumber)); + Assert.Throws(() => Camera.GetDeviceState(_invalidDevideNumber), + "Should throws proper exception"); } [Test] @@ -152,7 +186,99 @@ namespace Tizen.Multimedia.Tests [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] public void ChangeDevice_THROWS_IF_PARAM_IS_INVALID() { - Assert.Throws(() => TestCamera.ChangeDevice(_invalidDevideNumber)); + Assert.Throws(() => TestCamera.ChangeDevice(_invalidDevideNumber), + "Should throws proper exception"); + } + + [Test] + [Category("P2")] + [Description("Method throws InvalidOperationException if the current state is invalid.")] + [Property("SPEC", "Tizen.Multimedia.Camera.ChangeDevice M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public async Task ChangeDevice_THROWS_IF_STATE_IS_INVALID() + { + if (IsSupportedSecondaryCamera() == false) + { + Assert.Pass("Secondary Camera is not supported."); + } + + using (var eventWaiter = EventAwaiter.Create()) + { + TestCamera.StateChanged += eventWaiter; + + try + { + TestCamera.StartPreview(); + await eventWaiter.IsRaisedAsync(); + } + finally + { + TestCamera.StateChanged -= eventWaiter; + } + + } + + Assert.Throws(() => TestCamera.ChangeDevice(CameraDevice.Front)); + } + + [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.Camera.ChangeDevice M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void ChangeDevice_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => TestCamera.ChangeDevice(CameraDevice.Front), + "Should throws proper exception"); + } + + [Test] + [Category("P2")] + [Description("Method throws InvalidOperationException if the current state is invalid.")] + [Property("SPEC", "Tizen.Multimedia.Camera.StartPreview M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public async Task StartPreview_THROWS_IF_STATE_IS_INVALID() + { + using (var eventWaiter = EventAwaiter.Create()) + { + TestCamera.StateChanged += eventWaiter; + + try + { + TestCamera.StartPreview(); + await eventWaiter.IsRaisedAsync(); + } + finally + { + TestCamera.StateChanged -= eventWaiter; + } + } + + Assert.Throws(() => TestCamera.StartPreview(), + "Should throws proper exception"); + } + + [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.Camera.StartPreview M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void StartPreview_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => TestCamera.StartPreview(), + "Should throws proper exception"); } [Test] @@ -168,9 +294,15 @@ namespace Tizen.Multimedia.Tests { TestCamera.StateChanged += eventWaiter; - TestCamera.StartPreview(); - - await eventWaiter.IsRaisedAsync(); + try + { + TestCamera.StartPreview(); + await eventWaiter.IsRaisedAsync(); + } + finally + { + TestCamera.StateChanged -= eventWaiter; + } } TestCamera.StopPreview(); @@ -178,6 +310,34 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws InvalidOperationException if the current state is invalid.")] + [Property("SPEC", "Tizen.Multimedia.Camera.StopPreview M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void StopPreview_THROWS_IF_STATE_IS_INVALID() + { + Assert.Throws(() => TestCamera.StopPreview(), + "Should throws proper exception"); + } + + [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.Camera.StopPreview M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void StopPreview_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => TestCamera.StopPreview(), + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test the StopContinuousCapture method.")] [Property("SPEC", "Tizen.Multimedia.Camera.StartCapture M")] @@ -189,37 +349,49 @@ namespace Tizen.Multimedia.Tests { TestCamera.StartPreview(); - using (var completeWaiter = EventAwaiter.Create()) using (var tokenSource = new CancellationTokenSource()) { - try + using (var completeWaiter = EventAwaiter.Create()) { - TestCamera.Capturing += completeWaiter; + try + { + TestCamera.Capturing += completeWaiter; - TestCamera.StartCapture(10, 100, tokenSource.Token); + TestCamera.StartCapture(10, 100, tokenSource.Token); - await completeWaiter.IsRaisedAsync(); - } - catch (NotSupportedException) - { - if (TestCamera.Capabilities.IsContinuousCaptureSupported) - Assert.Fail("Continuous capture is failed."); - else - Assert.Pass("Continuous capture feature is not supported."); - } - catch (Exception ex) - { - Assert.Fail("Continuous capture is failed. Msg : " + ex.ToString()); + await completeWaiter.IsRaisedAsync(); + } + catch (NotSupportedException) + { + if (TestCamera.Capabilities.IsContinuousCaptureSupported) + Assert.Fail("Continuous capture is failed."); + else + Assert.Pass("Continuous capture feature is not supported."); + } + catch (Exception ex) + { + Assert.Fail("Continuous capture is failed. Msg : " + ex.ToString()); + } + finally + { + TestCamera.Capturing -= completeWaiter; + } } - /* TESTCODE */ using (var eventWaiter = EventAwaiter.Create()) { + /* TESTCODE */ TestCamera.StateChanged += eventWaiter; - tokenSource.Cancel(); - - await eventWaiter.IsRaisedAsync(); + try + { + tokenSource.Cancel(); + await eventWaiter.IsRaisedAsync(); + } + finally + { + TestCamera.StateChanged -= eventWaiter; + } } Assert.That(TestCamera.State, Is.EqualTo(CameraState.Captured)); @@ -280,6 +452,122 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws InvalidOperationException if the current state is invalid.")] + [Property("SPEC", "Tizen.Multimedia.Camera.StartCapture M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void StartCapture_THROWS_IF_STATE_IS_INVALID() + { + Assert.Throws(() => TestCamera.StartCapture(), + "Should throws proper exception"); + } + + [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.Camera.StartCapture M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void StartCapture_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => TestCamera.StartCapture(), + "Should throws proper exception"); + } + + [Test] + [Category("P2")] + [Description("Method throws InvalidOperationException if the current state is invalid.")] + [Property("SPEC", "Tizen.Multimedia.Camera.StartCapture M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("COVPARAM", "int, int, CancellationToken")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void StartCapture_WITH_PARAM_THROWS_IF_STATE_IS_INVALID() + { + Assert.Throws(() => TestCamera.StartCapture(3, 10, CancellationToken.None), + "Should throws proper exception"); + } + + [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.Camera.StartCapture M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("COVPARAM", "int, int, CancellationToken")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void StartCapture_WITH_PARAM_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => TestCamera.StartCapture(3, 10, CancellationToken.None), + "Should throws proper exception"); + } + + [Test] + [Category("P2")] + [Description("Method throws ArgumentOutOfRangeException if count parameter is invalid.")] + [Property("SPEC", "Tizen.Multimedia.Camera.StartCapture M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("COVPARAM", "int, int, CancellationToken")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public async Task StartCapture_WITH_PARAM_THROWS_IF_COUNT_PARAM_IS_INVALID() + { + using (var eventWaiter = EventAwaiter.Create()) + { + TestCamera.StateChanged += eventWaiter; + + try + { + TestCamera.StartPreview(); + await eventWaiter.IsRaisedAsync(); + } + finally + { + TestCamera.StateChanged -= eventWaiter; + } + } + + Assert.Throws(() => TestCamera.StartCapture(1, 10, CancellationToken.None), + "Should throws proper exception"); + } + + [Test] + [Category("P2")] + [Description("Method throws ArgumentOutOfRangeException if interval parameter is invalid.")] + [Property("SPEC", "Tizen.Multimedia.Camera.StartCapture M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("COVPARAM", "int, int, CancellationToken")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public async Task StartCapture_WITH_PARAM_THROWS_IF_INTERVAL_PARAM_IS_INVALID() + { + using (var eventWaiter = EventAwaiter.Create()) + { + TestCamera.StateChanged += eventWaiter; + + try + { + TestCamera.StartPreview(); + await eventWaiter.IsRaisedAsync(); + } + finally + { + TestCamera.StateChanged -= eventWaiter; + } + } + + Assert.Throws(() => TestCamera.StartCapture(3, -1, CancellationToken.None), + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test StopFaceDetection method. The method should work without any exception.")] [Property("SPEC", "Tizen.Multimedia.Camera.StopFaceDetection M")] @@ -314,6 +602,90 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws InvalidOperationException if the current state is invalid.")] + [Property("SPEC", "Tizen.Multimedia.Camera.StopFaceDetection M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void StopFaceDetection_WITH_STATE_IS_INVALID() + { + TestCamera.StartPreview(); + + try + { + TestCamera.StopFaceDetection(); + } + catch (InvalidOperationException) + { + Assert.Pass("Proper exception is occurred."); + } + catch (NotSupportedException) + { + if (TestCamera.Capabilities.IsFaceDetectionSupported) + Assert.Fail("Face Detection feature is supported. But StartFaceDetection returns NotSupportedException."); + else + Assert.Pass("Face Detection feature is not supported."); + } + } + + [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.Camera.StopFaceDetection M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void StopFaceDetection_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => TestCamera.StopFaceDetection(), + "Should throws proper exception"); + } + + [Test] + [Category("P2")] + [Description("Method throws InvalidOperationException if the current state is invalid.")] + [Property("SPEC", "Tizen.Multimedia.Camera.StartFaceDetection M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void StartFaceDetection_WITH_STATE_IS_INVALID() + { + try + { + TestCamera.StartFaceDetection(); + } + catch (NotSupportedException) + { + if (TestCamera.Capabilities.IsFaceDetectionSupported) + Assert.Fail("Face Detection feature is supported. But StartFaceDetection returns NotSupportedException."); + else + Assert.Pass("Face Detection feature is not supported."); + } + catch (InvalidOperationException) + { + Assert.Pass("Proper exception is occurred."); + } + } + + [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.Camera.StartFaceDetection M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void StartFaceDetection_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => TestCamera.StartFaceDetection(), + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test CancelFocusing method. The method should work without any exception.")] [Property("SPEC", "Tizen.Multimedia.Camera.StopFocusing M")] @@ -360,6 +732,90 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws InvalidOperationException if the current state is invalid.")] + [Property("SPEC", "Tizen.Multimedia.Camera.StartFocusing M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void StartFocusing_TRUE_WITH_STATE_IS_INVALID() + { + Assert.Throws(() => TestCamera.StartFocusing(true), + "Should throws proper exception"); + } + + [Test] + [Category("P2")] + [Description("Method throws InvalidOperationException if the current state is invalid.")] + [Property("SPEC", "Tizen.Multimedia.Camera.StartFocusing M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void StartFocusing_FALSE_WITH_STATE_IS_INVALID() + { + Assert.Throws(() => TestCamera.StartFocusing(false), + "Should throws proper exception"); + } + + [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.Camera.StartFocusing M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void StartFocusing_TRUE_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => TestCamera.StartFocusing(true), + "Should throws proper exception"); + } + + [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.Camera.StartFocusing M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void StartFocusing_FALSE_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => TestCamera.StartFocusing(false), + "Should throws proper exception"); + } + + [Test] + [Category("P2")] + [Description("Method throws InvalidOperationException if the current state is invalid.")] + [Property("SPEC", "Tizen.Multimedia.Camera.StopFocusing M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void StopFocusing_WITH_STATE_IS_INVALID() + { + Assert.Throws(() => TestCamera.StopFocusing(), + "Should throws proper exception"); + } + + [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.Camera.StopFocusing M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void StopFocusing_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => TestCamera.StopFocusing(), + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test all available camera state.")] [Property("SPEC", "Tizen.Multimedia.Camera.State A")] @@ -371,19 +827,42 @@ namespace Tizen.Multimedia.Tests Assert.That(TestCamera.State, Is.EqualTo(CameraState.Created)); TestCamera.StartPreview(); + Assert.That(TestCamera.State, Is.EqualTo(CameraState.Preview)); using (var eventWaiter = EventAwaiter.Create()) { TestCamera.CaptureCompleted += eventWaiter; - TestCamera.StartCapture(); - - Assert.That(await eventWaiter.IsRaisedAsync()); + try + { + TestCamera.StartCapture(); + Assert.That(await eventWaiter.IsRaisedAsync()); + } + finally + { + TestCamera.CaptureCompleted -= eventWaiter; + } } } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.Camera.State A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void State_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + CameraState state = CameraState.None; + Assert.Throws(() => state = TestCamera.State, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test DisplayReuseHint property whether it is set correctly or not.")] [Property("SPEC", "Tizen.Multimedia.Camera.DisplayReuseHint A")] @@ -396,9 +875,15 @@ namespace Tizen.Multimedia.Tests { TestCamera.StateChanged += eventWaiter; - TestCamera.StartPreview(); - - await eventWaiter.IsRaisedAsync(); + try + { + TestCamera.StartPreview(); + await eventWaiter.IsRaisedAsync(); + } + finally + { + TestCamera.StateChanged -= eventWaiter; + } } TestCamera.DisplayReuseHint = true; @@ -407,6 +892,34 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws InvalidOperationException if the current state is invalid.")] + [Property("SPEC", "Tizen.Multimedia.Camera.DisplayReuseHint A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void DisplayReuseHint_THROWS_IF_STATE_IS_INVALID() + { + Assert.Throws(() => TestCamera.DisplayReuseHint = true, + "Should throws proper exception"); + } + + [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.Camera.DisplayReuseHint A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void DisplayReuseHint_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => TestCamera.DisplayReuseHint = true, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test Setting property of the camera.")] [Property("SPEC", "Tizen.Multimedia.Camera.Settings A")] @@ -463,6 +976,22 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.Camera.Direction A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Direction_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + CameraFacingDirection direction = CameraFacingDirection.Front; + Assert.Throws(() => direction = TestCamera.Direction, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test Flash state property of the camera.")] [Property("SPEC", "Tizen.Multimedia.Camera.GetFlashState M")] @@ -484,6 +1013,33 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ArgumentException if the current state is invalid.")] + [Property("SPEC", "Tizen.Multimedia.Camera.GetFlashState M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void GetFlashState_THROWS_IF_PARAM_IS_INVALID() + { + try + { + var state = Camera.GetFlashState(CameraDevice.CameraDevice9 + 1); + } + catch (ArgumentException) + { + Assert.Pass("Proper exception is occurred."); + } + catch (NotSupportedException) + { + Assert.Pass("Flash feature is not supported."); + } + catch (Exception ex) + { + Assert.Fail("Proper exception is not occurred. Msg : " + ex.ToString()); + } + } + + [Test] [Category("P1")] [Description("Test camera count property of the camera.")] [Property("SPEC", "Tizen.Multimedia.Camera.CameraCount A")] @@ -498,9 +1054,25 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.Camera.CameraCount A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void CameraCount_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + int count = 0; + Assert.Throws(() => count = TestCamera.CameraCount, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test HdrCaptureProgress Event.")] - [Property("SPEC", "Tizen.Multimedia.Camera.HdrCaptureProgress A")] + [Property("SPEC", "Tizen.Multimedia.Camera.HdrCaptureProgress E")] [Property("SPEC_URL", "-")] [Property("CRITERIA", "EVL")] [Property("AUTHOR", "Vivek Ellur, vivek.ellur@samsung.com")] @@ -519,13 +1091,21 @@ namespace Tizen.Multimedia.Tests TestCamera.HdrCaptureProgress += eventWaiter; TestCamera.CaptureCompleted += completeWaiter; - TestCamera.StartPreview(); - TestCamera.StartCapture(); + try + { + TestCamera.StartPreview(); + TestCamera.StartCapture(); - var eventArgs = await eventWaiter.GetResultAsync(); - Assert.That(eventArgs.Percent, Is.GreaterThan(0), "HDR progress should be bigger than 0."); + var eventArgs = await eventWaiter.GetResultAsync(); + Assert.That(eventArgs.Percent, Is.GreaterThan(0), "HDR progress should be bigger than 0."); - await completeWaiter.IsRaisedAsync(); + await completeWaiter.IsRaisedAsync(); + } + finally + { + TestCamera.HdrCaptureProgress -= eventWaiter; + TestCamera.CaptureCompleted -= completeWaiter; + } } } @@ -547,12 +1127,20 @@ namespace Tizen.Multimedia.Tests TestCamera.Capturing += eventWaiter; TestCamera.CaptureCompleted += completeWaiter; - TestCamera.StartPreview(); - TestCamera.StartCapture(); + try + { + TestCamera.StartPreview(); + TestCamera.StartCapture(); - Assert.That(await eventWaiter.IsRaisedAsync()); + Assert.That(await eventWaiter.IsRaisedAsync()); - await completeWaiter.IsRaisedAsync(); + await completeWaiter.IsRaisedAsync(); + } + finally + { + TestCamera.Capturing -= eventWaiter; + TestCamera.CaptureCompleted -= completeWaiter; + } } } @@ -574,12 +1162,20 @@ namespace Tizen.Multimedia.Tests TestCamera.CaptureCompleted += eventWaiter; TestCamera.CaptureCompleted += completeWaiter; - TestCamera.StartPreview(); - TestCamera.StartCapture(); + try + { + TestCamera.StartPreview(); + TestCamera.StartCapture(); - Assert.That(await eventWaiter.IsRaisedAsync()); + Assert.That(await eventWaiter.IsRaisedAsync()); - await completeWaiter.IsRaisedAsync(); + await completeWaiter.IsRaisedAsync(); + } + finally + { + TestCamera.CaptureCompleted -= eventWaiter; + TestCamera.CaptureCompleted -= completeWaiter; + } } } @@ -596,9 +1192,16 @@ namespace Tizen.Multimedia.Tests { TestCamera.StateChanged += eventWaiter; - TestCamera.StartPreview(); + try + { + TestCamera.StartPreview(); - Assert.That(await eventWaiter.IsRaisedAsync()); + Assert.That(await eventWaiter.IsRaisedAsync()); + } + finally + { + TestCamera.StateChanged -= eventWaiter; + } } } @@ -615,9 +1218,16 @@ namespace Tizen.Multimedia.Tests { Camera.DeviceStateChanged += eventWaiter; - TestCamera.StartPreview(); + try + { + TestCamera.StartPreview(); - Assert.That(await eventWaiter.IsRaisedAsync()); + Assert.That(await eventWaiter.IsRaisedAsync()); + } + finally + { + Camera.DeviceStateChanged -= eventWaiter; + } } } @@ -640,6 +1250,10 @@ namespace Tizen.Multimedia.Tests { Assert.Fail("Exception is occured. msg : " + ex.ToString()); } + finally + { + TestCamera.Interrupted -= eventWaiter; + } } } @@ -656,12 +1270,16 @@ namespace Tizen.Multimedia.Tests { try { - TestCamera.InterruptStarted += (s, e) => { }; + TestCamera.InterruptStarted += eventWaiter; } catch (Exception ex) { Assert.Fail("Exception is occured. msg : " + ex.ToString()); } + finally + { + TestCamera.InterruptStarted -= eventWaiter; + } } } @@ -678,12 +1296,16 @@ namespace Tizen.Multimedia.Tests { try { - TestCamera.ErrorOccurred += (s, e) => { }; + TestCamera.ErrorOccurred += eventWaiter; } catch (Exception ex) { Assert.Fail("Exception is occured. msg : " + ex.ToString()); } + finally + { + TestCamera.ErrorOccurred -= eventWaiter; + } } } @@ -700,9 +1322,16 @@ namespace Tizen.Multimedia.Tests { TestCamera.StateChanged += eventWaiter; - TestCamera.StartPreview(); + try + { + TestCamera.StartPreview(); - Assert.That(await eventWaiter.IsRaisedAsync()); + Assert.That(await eventWaiter.IsRaisedAsync()); + } + finally + { + TestCamera.StateChanged -= eventWaiter; + } } } @@ -724,11 +1353,18 @@ namespace Tizen.Multimedia.Tests { TestCamera.MediaPacketPreview += eventWaiter; - TestCamera.StartPreview(); + try + { + TestCamera.StartPreview(); - var eventArgs = await eventWaiter.GetResultAsync(); + var eventArgs = await eventWaiter.GetResultAsync(); - Assert.IsNotNull(eventArgs.Packet); + Assert.IsNotNull(eventArgs.Packet); + } + finally + { + TestCamera.MediaPacketPreview -= eventWaiter; + } } } @@ -746,6 +1382,21 @@ namespace Tizen.Multimedia.Tests [Test] [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.Camera.Handle A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Handle_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => { var handle = TestCamera.Handle; }, + "Should throws proper exception"); + } + + [Test] + [Category("P2")] [Description("Test Dispose method by checking whether it changes the camera state to Created.")] [Property("SPEC", "Tizen.Multimedia.Camera.Dispose M")] [Property("SPEC_URL", "-")] @@ -755,7 +1406,8 @@ namespace Tizen.Multimedia.Tests { TestCamera.Dispose(); - Assert.Throws(() => { IntPtr handle = TestCamera.Handle; }); + Assert.Throws(() => { IntPtr handle = TestCamera.Handle; }, + "Should throws proper exception"); } } } diff --git a/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraCapabilities.cs b/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraCapabilities.cs old mode 100755 new mode 100644 index d7b6679..18df4da --- a/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraCapabilities.cs +++ b/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraCapabilities.cs @@ -7,6 +7,7 @@ // you entered into with Samsung. using NUnit.Framework; +using System; using System.Linq; using System.Collections; @@ -228,6 +229,23 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.SupportedPreviewResolutions A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void SupportedPreviewResolutions_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => + { + var result = TestCamera.Capabilities.SupportedPreviewResolutions; + }, "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test CaptureResolutions supported property. Supported list should be greater than 0")] [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.SupportedCaptureResolutions A")] @@ -243,6 +261,23 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.SupportedCaptureResolutions A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void SupportedCaptureResolutions_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => + { + var result = TestCamera.Capabilities.SupportedCaptureResolutions; + }, "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test CaptureFormats supported property. Supported list should be greater than 0")] [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.SupportedCapturePixelFormats A")] @@ -258,6 +293,23 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.SupportedCapturePixelFormats A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void SupportedCapturePixelFormats_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => + { + var result = TestCamera.Capabilities.SupportedCapturePixelFormats; + }, "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test PreviewFormats supported property. Supported list should be greater than 0")] [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.SupportedPreviewPixelFormats A")] @@ -273,6 +325,26 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.SupportedPreviewPixelFormats A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void SupportedPreviewPixelFormats_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + using (var camera = new Camera(CameraDevice.Front)) + { + camera.Dispose(); + + Assert.Throws(() => + { + var result = camera.Capabilities.SupportedPreviewPixelFormats; + }, "Should throws proper exception"); + } + } + + [Test] [Category("P1")] [Description("Test Supported Fps property. Supported list should be greater than 0")] [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.SupportedPreviewFps A")] @@ -288,6 +360,23 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.SupportedPreviewFps A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void SupportedPreviewFps_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => + { + var result = TestCamera.Capabilities.SupportedPreviewFps; + }, "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test Supported FpsByResolution method. Supported list should be greater than 0")] [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.GetSupportedPreviewFpsByResolution M")] @@ -297,13 +386,30 @@ namespace Tizen.Multimedia.Tests [Property("AUTHOR", "Vivek Ellur, vivek.ellur@samsung.com")] public void GetSupportedPreviewFpsByResolution_INT_RETURN_TYPE() { - IList result = TestCamera.Capabilities.SupportedPreviewResolutions.ToList(); + var result = TestCamera.Capabilities.GetSupportedPreviewFpsByResolution(640, 480).ToList(); Assert.IsNotNull(result, "The FpsByResolution should not be null."); Assert.IsNotEmpty(result, "The FpsByResolution should not be empty."); Assert.Greater(result.Count, 0, "The FpsByResolution count should be greater than 0"); } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.GetSupportedPreviewFpsByResolution M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("COVPARAM", "int, int")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void GetSupportedPreviewFpsByResolution_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => + TestCamera.Capabilities.GetSupportedPreviewFpsByResolution(640, 480), + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test Supported FpsByResolution method. Supported list should be greater than 0")] [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.GetSupportedPreviewFpsByResolution M")] @@ -322,6 +428,23 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.GetSupportedPreviewFpsByResolution M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("COVPARAM", "Size")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void GetSupportedPreviewFpsByResolution_SIZE_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => + TestCamera.Capabilities.GetSupportedPreviewFpsByResolution(new Size(640, 480)), + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test Supported AfMode property. Supported list should be greater than 0")] [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.SupportedAutoFocusModes A")] @@ -337,6 +460,23 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.SupportedAutoFocusModes A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void SupportedAutoFocusModes_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => + { + var modes = TestCamera.Capabilities.SupportedAutoFocusModes; + }, "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test Supported ExposureModes property. Supported list should be greater than 0")] [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.SupportedExposureModes A")] @@ -352,6 +492,23 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.SupportedExposureModes A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void SupportedExposureModes_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => + { + var modes = TestCamera.Capabilities.SupportedExposureModes; + }, "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test Supported IsoLevel property. Supported list should be greater than 0")] [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.SupportedIsoLevels A")] @@ -367,6 +524,23 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.SupportedIsoLevels A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void SupportedIsoLevels_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => + { + var levels = TestCamera.Capabilities.SupportedIsoLevels; + }, "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test Supported TheaterMode property. Supported list should be greater than 0")] [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.SupportedTheaterModes A")] @@ -382,6 +556,23 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.SupportedTheaterModes A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void SupportedTheaterModes_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => + { + var modes = TestCamera.Capabilities.SupportedTheaterModes; + }, "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test Supported Whitebalance property. Supported list should be greater than 0")] [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.SupportedWhiteBalances A")] @@ -397,6 +588,23 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.SupportedWhiteBalances A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void SupportedWhiteBalances_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => + { + var whiteBalances = TestCamera.Capabilities.SupportedWhiteBalances; + }, "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test Supported FlashMode property. Supported list should be greater than 0")] [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.SupportedFlashModes A")] @@ -412,6 +620,23 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.SupportedFlashModes A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void SupportedFlashModes_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => + { + var modes = TestCamera.Capabilities.SupportedFlashModes; + }, "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test Supported SceneMode property. Supported list should be greater than 0")] [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.SupportedSceneModes A")] @@ -427,6 +652,23 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.SupportedSceneModes A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void SupportedSceneModes_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => + { + var modes = TestCamera.Capabilities.SupportedSceneModes; + }, "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test supported Effect property. Supported list should be greater than 0")] [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.SupportedEffects A")] @@ -442,6 +684,23 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.SupportedEffects A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void SupportedEffects_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => + { + var effects = TestCamera.Capabilities.SupportedEffects; + }, "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test supported StreamRotation property. Supported list should be greater than 0")] [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.SupportedStreamRotations A")] @@ -457,6 +716,23 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.SupportedStreamRotations A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void SupportedStreamRotations_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => + { + var rotations = TestCamera.Capabilities.SupportedStreamRotations; + }, "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test supported StreamFlip property. Supported list should be greater than 0")] [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.SupportedStreamFlips A")] @@ -472,6 +748,23 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.SupportedStreamFlips A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void SupportedStreamFlips_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => + { + var flips = TestCamera.Capabilities.SupportedStreamFlips; + }, "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test supported PtzType property.")] [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.SupportedPtzTypes A")] @@ -488,5 +781,27 @@ namespace Tizen.Multimedia.Tests IList result = TestCamera.Capabilities.SupportedPtzTypes.ToList(); Assert.IsNotNull(result, "The PtzType should not be null."); } + + [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraCapabilities.SupportedPtzTypes A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void SupportedPtzTypes_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + if (TestCamera.Capabilities.IsPanSupported == false) + { + Assert.Pass("Ptz feature is not supported."); + } + + TestCamera.Dispose(); + + Assert.Throws(() => + { + var types = TestCamera.Capabilities.SupportedPtzTypes; + }, "Should throws proper exception"); + } } } diff --git a/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraCapturingEventArgs.cs b/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraCapturingEventArgs.cs old mode 100755 new mode 100644 index 0b5bbb3..4f4b57a --- a/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraCapturingEventArgs.cs +++ b/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraCapturingEventArgs.cs @@ -38,13 +38,21 @@ namespace Tizen.Multimedia.Tests TestCamera.Capturing += eventWaiter; TestCamera.CaptureCompleted += completeWaiter; - TestCamera.StartPreview(); - TestCamera.StartCapture(); + try + { + TestCamera.StartPreview(); + TestCamera.StartCapture(); - var eventArgs = await eventWaiter.GetResultAsync(); - Assert.That(eventArgs.MainImage.Data.Length, Is.GreaterThan(0)); + var eventArgs = await eventWaiter.GetResultAsync(); + Assert.That(eventArgs.MainImage.Data.Length, Is.GreaterThan(0)); - await completeWaiter.IsRaisedAsync(); + await completeWaiter.IsRaisedAsync(); + } + finally + { + TestCamera.Capturing -= eventWaiter; + TestCamera.CaptureCompleted -= completeWaiter; + } } } @@ -63,12 +71,20 @@ namespace Tizen.Multimedia.Tests TestCamera.Capturing += eventWaiter; TestCamera.CaptureCompleted += completeWaiter; - TestCamera.StartPreview(); - TestCamera.StartCapture(); + try + { + TestCamera.StartPreview(); + TestCamera.StartCapture(); - Assert.That(await eventWaiter.IsRaisedAsync()); + Assert.That(await eventWaiter.IsRaisedAsync()); - await completeWaiter.IsRaisedAsync(); + await completeWaiter.IsRaisedAsync(); + } + finally + { + TestCamera.Capturing -= eventWaiter; + TestCamera.CaptureCompleted -= completeWaiter; + } } } @@ -87,12 +103,20 @@ namespace Tizen.Multimedia.Tests TestCamera.Capturing += eventWaiter; TestCamera.CaptureCompleted += completeWaiter; - TestCamera.StartPreview(); - TestCamera.StartCapture(); + try + { + TestCamera.StartPreview(); + TestCamera.StartCapture(); - Assert.That(await eventWaiter.IsRaisedAsync()); + Assert.That(await eventWaiter.IsRaisedAsync()); - await completeWaiter.IsRaisedAsync(); + await completeWaiter.IsRaisedAsync(); + } + finally + { + TestCamera.Capturing -= eventWaiter; + TestCamera.CaptureCompleted -= completeWaiter; + } } } } diff --git a/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraDeviceStateChangedEventArgs.cs b/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraDeviceStateChangedEventArgs.cs old mode 100755 new mode 100644 index 1693ac0..1b6ff6f --- a/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraDeviceStateChangedEventArgs.cs +++ b/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraDeviceStateChangedEventArgs.cs @@ -53,9 +53,16 @@ namespace Tizen.Multimedia.Tests { Camera.DeviceStateChanged += eventWaiter; - TestCamera.StartPreview(); + try + { + TestCamera.StartPreview(); - Assert.That(await eventWaiter.IsRaisedAsync()); + Assert.That(await eventWaiter.IsRaisedAsync()); + } + finally + { + Camera.DeviceStateChanged -= eventWaiter; + } } } } diff --git a/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraDisplaySettings.cs b/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraDisplaySettings.cs old mode 100755 new mode 100644 index 14c2940..9ba1750 --- a/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraDisplaySettings.cs +++ b/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraDisplaySettings.cs @@ -33,6 +33,74 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraDisplaySettings.Rotation A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Rotation_GET_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => + { + var rotation = TestCamera.DisplaySettings.Rotation; + }, "Should throws proper exception"); + } + + [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraDisplaySettings.Rotation A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Rotation_SET_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => + { + TestCamera.DisplaySettings.Rotation = Rotation.Rotate270; + }, "Should throws proper exception"); + } + + [Test] + [Category("P2")] + [Description("Method throws ArgumentException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraDisplaySettings.Rotation A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PAM")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Rotation_SET_THROWS_IF_PARAM_IS_INVALID_PAM() + { + TestCamera.Dispose(); + + Assert.Throws(() => + { + TestCamera.DisplaySettings.Rotation = Rotation.Rotate270 + 1; + }, "Should throws proper exception"); + } + + [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraDisplaySettings.Rotation A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PBM")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Rotation_SET_THROWS_IF_PARAM_IS_INVALID_PBM() + { + TestCamera.Dispose(); + + Assert.Throws(() => + { + TestCamera.DisplaySettings.Rotation = Rotation.Rotate0 - 1; + }, "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test Flip property of CameraDisplaySettings class.")] [Property("SPEC", "Tizen.Multimedia.CameraDisplaySettings.Flip A")] @@ -50,6 +118,72 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraDisplaySettings.Flip A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Flip_GET_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => + { + var flip = TestCamera.DisplaySettings.Flip; + }, "Should throws proper exception"); + } + + [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraDisplaySettings.Flip A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Flip_SET_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => + { + TestCamera.DisplaySettings.Flip = Flips.Horizontal; + }, "Should throws proper exception"); + } + + [Test] + [Category("P2")] + [Description("Method throws ArgumentException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraDisplaySettings.Flip A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PAM")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Flip_SET_THROWS_IF_PARAM_IS_INVALID_PAM() + { + Assert.Throws(() => + { + TestCamera.DisplaySettings.Flip = (Flips.Horizontal | Flips.Vertical) + 1; + }, "Should throws proper exception"); + } + + [Test] + [Category("P2")] + [Description("Method throws ArgumentException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraDisplaySettings.Flip A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PAM")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Flip_SET_THROWS_IF_PARAM_IS_INVALID_PBM() + { + TestCamera.Dispose(); + + Assert.Throws(() => + { + TestCamera.DisplaySettings.Flip = Flips.None - 1; + }, "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test mode property of CameraDisplaySettings class.")] [Property("SPEC", "Tizen.Multimedia.CameraDisplaySettings.Mode A")] @@ -66,6 +200,74 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraDisplaySettings.Mode A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Mode_GET_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => + { + var mode = TestCamera.DisplaySettings.Mode; + }, "Should throws proper exception"); + } + + [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraDisplaySettings.Mode A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Mode_SET_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => + { + TestCamera.DisplaySettings.Mode = CameraDisplayMode.LetterBox; + }, "Should throws proper exception"); + } + + [Test] + [Category("P2")] + [Description("Method throws ArgumentException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraDisplaySettings.Mode A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PAM")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Mode_SET_THROWS_IF_PARAM_IS_INVALID_PAM() + { + TestCamera.Dispose(); + + Assert.Throws(() => + { + TestCamera.DisplaySettings.Mode = CameraDisplayMode.CustomROI + 1; + }, "Should throws proper exception"); + } + + [Test] + [Category("P2")] + [Description("Method throws ArgumentException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraDisplaySettings.Mode A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PAM")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Mode_SET_THROWS_IF_PARAM_IS_INVALID_PBM() + { + TestCamera.Dispose(); + + Assert.Throws(() => + { + TestCamera.DisplaySettings.Mode = CameraDisplayMode.LetterBox - 1; + }, "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("")] [Property("SPEC", "Tizen.Multimedia.CameraDisplaySettings.Visible A")] @@ -79,6 +281,40 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraDisplaySettings.Visible A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Visible_GET_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => + { + var visible = TestCamera.DisplaySettings.Visible; + }, "Should throws proper exception"); + } + + [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraDisplaySettings.Visible A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Visible_SET_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => + { + TestCamera.DisplaySettings.Visible = true; + }, "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test DisplayRoiArea property.")] [Property("SPEC", "Tizen.Multimedia.CameraDisplaySettings.RoiArea A")] @@ -96,5 +332,39 @@ namespace Tizen.Multimedia.Tests Assert.That(TestCamera.DisplaySettings.RoiArea.Width, Is.EqualTo(area.Width)); Assert.That(TestCamera.DisplaySettings.RoiArea.Height, Is.EqualTo(area.Height)); } + + [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraDisplaySettings.RoiArea A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void RoiArea_GET_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => + { + var roi = TestCamera.DisplaySettings.RoiArea; + }, "Should throws proper exception"); + } + + [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraDisplaySettings.RoiArea A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void RoiArea_SET_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => + { + TestCamera.DisplaySettings.RoiArea = new Rectangle(0, 0, 100, 100); + }, "Should throws proper exception"); + } } } diff --git a/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraSettings.cs b/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraSettings.cs index 1258861..66d5de9 100644 --- a/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraSettings.cs +++ b/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraSettings.cs @@ -58,6 +58,37 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ArgumentException if the parameter is invalid.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.SetAutoFocusArea M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("COVPARAM", "int, int")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void SetAutoFocusArea_THROWS_IF_PARAM_IS_INVALID() + { + Assert.Throws(() => TestCamera.Settings.SetAutoFocusArea(100, -1)); + Assert.Throws(() => TestCamera.Settings.SetAutoFocusArea(-1, 100)); + Assert.Throws(() => TestCamera.Settings.SetAutoFocusArea(-1, -1)); + } + + [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.SetAutoFocusArea M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("COVPARAM", "int, int")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void SetAutoFocusArea_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => TestCamera.Settings.SetAutoFocusArea(100, 100), + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test SetFocusArea method.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.SetAutoFocusArea M")] @@ -99,6 +130,37 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ArgumentException if the parameter is invalid.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.SetAutoFocusArea M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("COVPARAM", "Point")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void SetAutoFocusArea_POINT_THROWS_IF_PARAM_IS_INVALID() + { + Assert.Throws(() => TestCamera.Settings.SetAutoFocusArea(new Point(100, -1))); + Assert.Throws(() => TestCamera.Settings.SetAutoFocusArea(new Point(-1, 100))); + Assert.Throws(() => TestCamera.Settings.SetAutoFocusArea(new Point(-1, -1))); + } + + [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.SetAutoFocusArea M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("COVPARAM", "Point")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void SetAutoFocusArea_POINT_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => TestCamera.Settings.SetAutoFocusArea(new Point(100, 100)), + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test ClearFocusArea method.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.ClearFocusArea M")] @@ -147,6 +209,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.ClearFocusArea M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void ClearFocusArea_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => TestCamera.Settings.ClearFocusArea(), + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test SetPan method.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.SetPan M")] @@ -175,6 +252,36 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.SetPan M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void SetPan_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => TestCamera.Settings.SetPan(CameraPtzMoveType.Absoulute, 10), + "Should throws proper exception"); + } + + [Test] + [Category("P2")] + [Description("Method throws ArgumentException if the parameter is invalid.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.SetPan M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void SetPan_THROWS_IF_PARAM_IS_INVALID() + { + Assert.Throws(() => TestCamera.Settings.SetPan(CameraPtzMoveType.Absoulute - 1, 10), + "Should throws proper exception"); + Assert.Throws(() => TestCamera.Settings.SetPan(CameraPtzMoveType.Relative + 1, 10), + "Should throws proper exception"); + } + + [Test] [Category("P0")] [Description("Test GetPan property.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.GetPan M")] @@ -200,6 +307,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.GetPan M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void GetPan_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => TestCamera.Settings.GetPan(), + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test SetTilt Property.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.SetTilt M")] @@ -223,11 +345,41 @@ namespace Tizen.Multimedia.Tests } catch (NotSupportedException) { - Assert.Pass("Pan feature is not supported."); + Assert.Pass("Tilt feature is not supported."); } } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.SetTilt M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void SetTilt_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => TestCamera.Settings.SetTilt(CameraPtzMoveType.Relative, 10), + "Should throws proper exception"); + } + + [Test] + [Category("P2")] + [Description("Method throws ArgumentException if the parameter is invalid.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.SetTilt M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void SetTilt_THROWS_IF_PARAM_IS_INVALID() + { + Assert.Throws(() => TestCamera.Settings.SetTilt(CameraPtzMoveType.Absoulute - 1, 10), + "Should throws proper exception"); + Assert.Throws(() => TestCamera.Settings.SetTilt(CameraPtzMoveType.Relative + 1, 10), + "Should throws proper exception"); + } + + [Test] [Category("P0")] [Description("")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.GetTilt M")] @@ -248,11 +400,26 @@ namespace Tizen.Multimedia.Tests } catch (NotSupportedException) { - Assert.Pass("Pan feature is not supported."); + Assert.Pass("Tilt feature is not supported."); } } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.GetTilt M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void GetTilt_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => TestCamera.Settings.GetTilt(), + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.RemoveGeoTag M")] @@ -276,6 +443,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.RemoveGeoTag M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void RemoveGeoTag_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => TestCamera.Settings.RemoveGeoTag(), + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test DisableShutterSound method.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.DisableShutterSound M")] @@ -295,6 +477,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.DisableShutterSound M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void DisableShutterSound_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => TestCamera.Settings.DisableShutterSound(true), + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test PreviewFps property.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.PreviewFps A")] @@ -313,6 +510,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.PreviewFps A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void PreviewFps_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => { var fps = TestCamera.Settings.PreviewFps; }, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test ImageQuality property.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.ImageQuality A")] @@ -330,6 +542,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.ImageQuality A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void ImageQuality_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => { var quality = TestCamera.Settings.ImageQuality; }, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test ImageQuality property. Check value for out of bound.(Below Min)")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.ImageQuality A")] @@ -401,6 +628,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.EncodedPreviewBitrate A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void EncodedPreviewBitrate_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => { var bitrate = TestCamera.Settings.EncodedPreviewBitrate; }, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test Encodedpreviewgop interval property.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.EncodedPreviewGopInterval A")] @@ -434,6 +676,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.EncodedPreviewGopInterval A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void EncodedPreviewGopInterval_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => { var gopInterval = TestCamera.Settings.EncodedPreviewGopInterval; }, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test zoomlevel property.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.ZoomLevel A")] @@ -460,6 +717,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.ZoomLevel A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void ZoomLevel_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => { var level = TestCamera.Settings.ZoomLevel; }, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test zoom range property.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.ZoomRange A")] @@ -626,6 +898,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.AutoFocusMode A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void AutoFocusMode_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => { var mode = TestCamera.Settings.AutoFocusMode; }, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test ExposureMode property.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.ExposureMode A")] @@ -644,6 +931,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.ExposureMode A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void ExposureMode_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => { var mode = TestCamera.Settings.ExposureMode; }, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test Exposure property.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.Exposure A")] @@ -667,6 +969,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.Exposure A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Exposure_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => { var exposure = TestCamera.Settings.Exposure; }, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test IsoLevel property.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.IsoLevel A")] @@ -685,6 +1002,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.IsoLevel A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void IsoLevel_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => { var level = TestCamera.Settings.IsoLevel; }, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test TheaterMode property.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.TheaterMode A")] @@ -703,6 +1035,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.TheaterMode A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void TheaterMode_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => { var mode = TestCamera.Settings.TheaterMode; }, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test Brightness property.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.Brightness A")] @@ -726,6 +1073,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.Brightness A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Brightness_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => { var brightness = TestCamera.Settings.Brightness; }, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test Contrast property.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.Contrast A")] @@ -749,6 +1111,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.Contrast A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Contrast_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => { var contrast = TestCamera.Settings.Contrast; }, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test Hue property.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.Hue A")] @@ -772,6 +1149,28 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.Hue A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Hue_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + if (TestCamera.Capabilities.IsHueSupported) + { + Assert.Throws(() => { var contrast = TestCamera.Settings.Hue; }, + "Should throws proper exception"); + } + else + { + Assert.Pass("Hue range feature is not supported."); + } + } + + [Test] [Category("P1")] [Description("Test Whitebalance property.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.WhiteBalance A")] @@ -790,6 +1189,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.WhiteBalance A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void WhiteBalance_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => { var wb = TestCamera.Settings.WhiteBalance; }, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test Effect setting.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.Effect A")] @@ -808,6 +1222,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.Effect A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Effect_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => { var effect = TestCamera.Settings.Effect; }, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test SceneMode setting.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.SceneMode A")] @@ -826,6 +1255,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.SceneMode A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void SceneMode_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => { var mode = TestCamera.Settings.SceneMode; }, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test EnableTag property.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.EnableTag A")] @@ -844,6 +1288,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.EnableTag A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void EnableTag_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => { var rag = TestCamera.Settings.EnableTag; }, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test ImageDescriptionTag property.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.ImageDescriptionTag A")] @@ -859,6 +1318,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.ImageDescriptionTag A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void ImageDescriptionTag_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => { var tag = TestCamera.Settings.ImageDescriptionTag; }, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test SoftwareTag property.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.SoftwareTag A")] @@ -874,6 +1348,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.SoftwareTag A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void SoftwareTag_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => { var tag = TestCamera.Settings.SoftwareTag; }, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test GeoTag property.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.GeoTag A")] @@ -896,6 +1385,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.GeoTag A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void GeoTag_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => { var tag = TestCamera.Settings.GeoTag; }, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test OrientationTag property.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.OrientationTag A")] @@ -910,6 +1414,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.OrientationTag A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void OrientationTag_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => { var tag = TestCamera.Settings.OrientationTag; }, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test FlashMode property.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.FlashMode A")] @@ -935,6 +1454,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.FlashMode A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void FlashMode_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => { var mode = TestCamera.Settings.FlashMode; }, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test LensOrientation property.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.LensOrientation A")] @@ -949,6 +1483,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.LensOrientation A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void LensOrientation_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => { var orientation = TestCamera.Settings.LensOrientation; }, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test StreamRotation property.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.StreamRotation A")] @@ -966,6 +1515,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.SupportedStreamRotations A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void StreamRotation_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => { var rotation = TestCamera.Settings.StreamRotation; }, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test StreamFlip property.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.StreamFlip A")] @@ -983,6 +1547,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.StreamFlip A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void StreamFlip_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => { var flip = TestCamera.Settings.StreamFlip; }, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test HdrMode property.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.HdrMode A")] @@ -1004,6 +1583,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.HdrMode A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void HdrMode_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => { var mode = TestCamera.Settings.HdrMode; }, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test Antishake property.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.AntiShake A")] @@ -1033,6 +1627,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.AntiShake A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void AntiShake_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => { var antiShake = TestCamera.Settings.AntiShake; }, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test VideoStabilization property.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.VideoStabilization A")] @@ -1062,6 +1671,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.VideoStabilization A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void VideoStabilization_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => { var vs = TestCamera.Settings.VideoStabilization; }, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test Autocontrast property.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.AutoContrast A")] @@ -1091,6 +1715,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.AutoContrast A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void AutoContrast_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => { var contrast = TestCamera.Settings.AutoContrast; }, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test PtzType.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.PtzType A")] @@ -1117,6 +1756,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.PtzType A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void PtzType_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => { TestCamera.Settings.PtzType = CameraPtzType.Electronic; }, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test capture format property of the camera.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.CapturePixelFormat A")] @@ -1137,6 +1791,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.CapturePixelFormat A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void CapturePixelFormat_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => { var format = TestCamera.Settings.CapturePixelFormat; }, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test preview format property of the camera.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.PreviewPixelFormat A")] @@ -1157,6 +1826,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.PreviewPixelFormat A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void PreviewPixelFormat_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => { var format = TestCamera.Settings.PreviewPixelFormat; }, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test PreviewResolution property of camera.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.PreviewResolution A")] @@ -1184,10 +1868,27 @@ namespace Tizen.Multimedia.Tests public void PreviewResolution_THROWS_EXCEPTION_IF_PARAM_IS_INVALID() { // Param is out of range. - Assert.Throws(() => TestCamera.Settings.PreviewResolution = new Size(-1, -1)); + Assert.Throws(() => TestCamera.Settings.PreviewResolution = new Size(-1, -1), + "Should throws proper exception"); // Not supported resolution matching. - Assert.Throws(() => TestCamera.Settings.PreviewResolution = new Size(640, 481)); + Assert.Throws(() => TestCamera.Settings.PreviewResolution = new Size(640, 481), + "Should throws proper exception"); + } + + [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.PreviewResolution A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void PreviewResolution_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => { var resolution = TestCamera.Settings.PreviewResolution; }, + "Should throws proper exception"); } [Test] @@ -1205,6 +1906,21 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.RecommendedPreviewResolution A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void RecommendedPreviewResolution_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => { var resolution = TestCamera.Settings.RecommendedPreviewResolution; }, + "Should throws proper exception"); + } + + [Test] [Category("P1")] [Description("Test capture resolution of the camera.")] [Property("SPEC", "Tizen.Multimedia.CameraSettings.CaptureResolution A")] @@ -1221,5 +1937,20 @@ namespace Tizen.Multimedia.Tests Assert.AreEqual(640, res.Width, "Resolution width is not same as set value."); Assert.AreEqual(480, res.Height, "Resolution Height is not same as set value."); } + + [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.CameraSettings.CaptureResolution A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void CaptureResolution_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => { var resolution = TestCamera.Settings.CaptureResolution; }, + "Should throws proper exception"); + } } } diff --git a/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraStateChangedEventArgs.cs b/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraStateChangedEventArgs.cs old mode 100755 new mode 100644 index 8f559fa..47adb1d --- a/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraStateChangedEventArgs.cs +++ b/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraStateChangedEventArgs.cs @@ -28,10 +28,17 @@ namespace Tizen.Multimedia.Tests { TestCamera.StateChanged += eventWaiter; - TestCamera.StartPreview(); + try + { + TestCamera.StartPreview(); - var eventArgs = await eventWaiter.GetResultAsync(); - Assert.That(eventArgs.Previous, Is.EqualTo(CameraState.Created)); + var eventArgs = await eventWaiter.GetResultAsync(); + Assert.That(eventArgs.Previous, Is.EqualTo(CameraState.Created)); + } + finally + { + TestCamera.StateChanged -= eventWaiter; + } } } @@ -48,10 +55,17 @@ namespace Tizen.Multimedia.Tests { TestCamera.StateChanged += eventWaiter; - TestCamera.StartPreview(); + try + { + TestCamera.StartPreview(); - var eventArgs = await eventWaiter.GetResultAsync(); - Assert.That(eventArgs.Current, Is.EqualTo(CameraState.Preview)); + var eventArgs = await eventWaiter.GetResultAsync(); + Assert.That(eventArgs.Current, Is.EqualTo(CameraState.Preview)); + } + finally + { + TestCamera.StateChanged -= eventWaiter; + } } } @@ -68,10 +82,17 @@ namespace Tizen.Multimedia.Tests { TestCamera.StateChanged += eventWaiter; - TestCamera.StartPreview(); + try + { + TestCamera.StartPreview(); - var eventArgs = await eventWaiter.GetResultAsync(); - Assert.That(eventArgs.ByPolicy, Is.False); + var eventArgs = await eventWaiter.GetResultAsync(); + Assert.That(eventArgs.ByPolicy, Is.False); + } + finally + { + TestCamera.StateChanged -= eventWaiter; + } } } } diff --git a/tct-suite-vs/Tizen.Camera.Tests/testcase/TSHdrCaptureProgressEventArgs.cs b/tct-suite-vs/Tizen.Camera.Tests/testcase/TSHdrCaptureProgressEventArgs.cs old mode 100755 new mode 100644 index c580f7c..acf8943 --- a/tct-suite-vs/Tizen.Camera.Tests/testcase/TSHdrCaptureProgressEventArgs.cs +++ b/tct-suite-vs/Tizen.Camera.Tests/testcase/TSHdrCaptureProgressEventArgs.cs @@ -39,13 +39,21 @@ namespace Tizen.Multimedia.Tests TestCamera.HdrCaptureProgress += eventWaiter; TestCamera.CaptureCompleted += completeWaiter; - TestCamera.StartPreview(); - TestCamera.StartCapture(); + try + { + TestCamera.StartPreview(); + TestCamera.StartCapture(); - var eventArgs = await eventWaiter.GetResultAsync(); - Assert.That(eventArgs.Percent, Is.GreaterThan(0)); + var eventArgs = await eventWaiter.GetResultAsync(); + Assert.That(eventArgs.Percent, Is.GreaterThan(0)); - await completeWaiter.IsRaisedAsync(); + await completeWaiter.IsRaisedAsync(); + } + finally + { + TestCamera.HdrCaptureProgress -= eventWaiter; + TestCamera.CaptureCompleted -= completeWaiter; + } } } } diff --git a/tct-suite-vs/Tizen.Camera.Tests/testcase/TSMediaPacketPreviewEventArgs.cs b/tct-suite-vs/Tizen.Camera.Tests/testcase/TSMediaPacketPreviewEventArgs.cs old mode 100755 new mode 100644 index 0cae55f..4ea87ca --- a/tct-suite-vs/Tizen.Camera.Tests/testcase/TSMediaPacketPreviewEventArgs.cs +++ b/tct-suite-vs/Tizen.Camera.Tests/testcase/TSMediaPacketPreviewEventArgs.cs @@ -33,11 +33,18 @@ namespace Tizen.Multimedia.Tests { TestCamera.MediaPacketPreview += eventWaiter; - TestCamera.StartPreview(); + try + { + TestCamera.StartPreview(); - var eventArgs = await eventWaiter.GetResultAsync(); + var eventArgs = await eventWaiter.GetResultAsync(); - Assert.IsNotNull(eventArgs.Packet); + Assert.IsNotNull(eventArgs.Packet); + } + finally + { + TestCamera.MediaPacketPreview -= eventWaiter; + } } } } diff --git a/tct-suite-vs/Tizen.Camera.Tests/testcase/TSStillImage.cs b/tct-suite-vs/Tizen.Camera.Tests/testcase/TSStillImage.cs old mode 100755 new mode 100644 index e57676f..e3dad21 --- a/tct-suite-vs/Tizen.Camera.Tests/testcase/TSStillImage.cs +++ b/tct-suite-vs/Tizen.Camera.Tests/testcase/TSStillImage.cs @@ -36,13 +36,21 @@ namespace Tizen.Multimedia.Tests TestCamera.Capturing += eventWaiter; TestCamera.CaptureCompleted += completeWaiter; - TestCamera.StartPreview(); - TestCamera.StartCapture(); - - var eventArgs = await eventWaiter.GetResultAsync(); - Assert.IsNotNull(eventArgs.MainImage.Data); - - await completeWaiter.IsRaisedAsync(); + try + { + TestCamera.StartPreview(); + TestCamera.StartCapture(); + + var eventArgs = await eventWaiter.GetResultAsync(); + Assert.IsNotNull(eventArgs.MainImage.Data); + + await completeWaiter.IsRaisedAsync(); + } + finally + { + TestCamera.Capturing -= eventWaiter; + TestCamera.CaptureCompleted -= completeWaiter; + } } } @@ -61,14 +69,22 @@ namespace Tizen.Multimedia.Tests TestCamera.Capturing += eventWaiter; TestCamera.CaptureCompleted += completeWaiter; - TestCamera.StartPreview(); - TestCamera.StartCapture(); - - var eventArgs = await eventWaiter.GetResultAsync(); - Assert.That(eventArgs.MainImage.Resolution.Width, Is.GreaterThan(0)); - Assert.That(eventArgs.MainImage.Resolution.Height, Is.GreaterThan(0)); - - await completeWaiter.IsRaisedAsync(); + try + { + TestCamera.StartPreview(); + TestCamera.StartCapture(); + + var eventArgs = await eventWaiter.GetResultAsync(); + Assert.That(eventArgs.MainImage.Resolution.Width, Is.GreaterThan(0)); + Assert.That(eventArgs.MainImage.Resolution.Height, Is.GreaterThan(0)); + + await completeWaiter.IsRaisedAsync(); + } + finally + { + TestCamera.Capturing -= eventWaiter; + TestCamera.CaptureCompleted -= completeWaiter; + } } } @@ -87,13 +103,21 @@ namespace Tizen.Multimedia.Tests TestCamera.Capturing += eventWaiter; TestCamera.CaptureCompleted += completeWaiter; - TestCamera.StartPreview(); - TestCamera.StartCapture(); - - var eventArgs = await eventWaiter.GetResultAsync(); - Assert.That(eventArgs.MainImage.Format, Is.EqualTo(CameraPixelFormat.Jpeg)); - - await completeWaiter.IsRaisedAsync(); + try + { + TestCamera.StartPreview(); + TestCamera.StartCapture(); + + var eventArgs = await eventWaiter.GetResultAsync(); + Assert.That(eventArgs.MainImage.Format, Is.EqualTo(CameraPixelFormat.Jpeg)); + + await completeWaiter.IsRaisedAsync(); + } + finally + { + TestCamera.Capturing -= eventWaiter; + TestCamera.CaptureCompleted -= completeWaiter; + } } } @@ -112,13 +136,21 @@ namespace Tizen.Multimedia.Tests TestCamera.Capturing += eventWaiter; TestCamera.CaptureCompleted += completeWaiter; - TestCamera.StartPreview(); - TestCamera.StartCapture(); - - var eventArgs = await eventWaiter.GetResultAsync(); - Assert.IsNotNull(eventArgs.MainImage.Exif); - - await completeWaiter.IsRaisedAsync(); + try + { + TestCamera.StartPreview(); + TestCamera.StartCapture(); + + var eventArgs = await eventWaiter.GetResultAsync(); + Assert.IsNotNull(eventArgs.MainImage.Exif); + + await completeWaiter.IsRaisedAsync(); + } + finally + { + TestCamera.Capturing -= eventWaiter; + TestCamera.CaptureCompleted -= completeWaiter; + } } } } diff --git a/tct-suite-vs/Tizen.Camera.UI.Tests/testcase/TSCamera.cs b/tct-suite-vs/Tizen.Camera.UI.Tests/testcase/TSCamera.cs index 358a505..939c24a 100644 --- a/tct-suite-vs/Tizen.Camera.UI.Tests/testcase/TSCamera.cs +++ b/tct-suite-vs/Tizen.Camera.UI.Tests/testcase/TSCamera.cs @@ -6,8 +6,10 @@ // it only in accordance with the terms of the license agreement // you entered into with Samsung. +using ElmSharp; using NUnit.Framework; using System; +using System.Threading.Tasks; using Tizen.Multimedia; namespace Tizen.Camera.UI.Tests @@ -42,5 +44,50 @@ namespace Tizen.Camera.UI.Tests Assert.Fail("Set display for surface type is failed."); } } + + [Test] + [Category("P2")] + [Description("Method throws InvalidOperationException if the current state is invalid.")] + [Property("SPEC", "Tizen.Multimedia.Camera.Display A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public async Task Display_THROWS_IF_STATE_IS_INVALID() + { + using (var eventWaiter = EventAwaiter.Create()) + { + TestCamera.StateChanged += eventWaiter; + + try + { + TestCamera.StartPreview(); + await eventWaiter.IsRaisedAsync(); + } + finally + { + TestCamera.StateChanged -= eventWaiter; + } + } + + Assert.Throws(() => + TestCamera.Display = new Display(new Window("test")), + "Should throws proper exception"); + } + + [Test] + [Category("P2")] + [Description("Method throws ObjectDisposedException if the object has already been disposed.")] + [Property("SPEC", "Tizen.Multimedia.Camera.Display A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Display_THROWS_IF_OBJECT_IS_ALREADY_DISPOSED() + { + TestCamera.Dispose(); + + Assert.Throws(() => + TestCamera.Display = new Display(new Window("test")), + "Should throws proper exception"); + } } } -- 2.7.4