From: Haesu Gwon Date: Sat, 22 Aug 2020 07:27:11 +0000 (+0900) Subject: [Camera][Non-ACR] Add new negative TCs X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8caeeb15eb17c97d071c76fda08d80d89efb8447;p=test%2Ftct%2Fcsharp%2Fapi.git [Camera][Non-ACR] Add new negative TCs Change-Id: I9fba1378ff4cd90a5c4665cd9fbd54aa21eb4311 --- diff --git a/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCamera.cs b/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCamera.cs index 325e2b364..72e5163be 100644 --- a/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCamera.cs +++ b/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCamera.cs @@ -55,6 +55,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.")] @@ -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,15 +294,49 @@ namespace Tizen.Multimedia.Tests { TestCamera.StateChanged += eventWaiter; - TestCamera.StartPreview(); - - await eventWaiter.IsRaisedAsync(); + try + { + TestCamera.StartPreview(); + await eventWaiter.IsRaisedAsync(); + } + finally + { + TestCamera.StateChanged -= eventWaiter; + } } TestCamera.StopPreview(); Assert.That(TestCamera.State, Is.EqualTo(CameraState.Created)); } + [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.")] @@ -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)); @@ -279,6 +451,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.")] @@ -313,6 +601,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.")] @@ -359,6 +731,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.")] @@ -371,18 +827,41 @@ 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.")] @@ -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; @@ -406,6 +891,34 @@ namespace Tizen.Multimedia.Tests Assert.IsTrue(TestCamera.DisplayReuseHint, "display reuse hint is not same as set value."); } + [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.")] @@ -462,6 +975,22 @@ namespace Tizen.Multimedia.Tests Assert.IsInstanceOf(direction, "The object should be of type CameraFacingDirection."); } + [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.")] @@ -483,6 +1012,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.")] @@ -497,10 +1053,26 @@ namespace Tizen.Multimedia.Tests Assert.IsTrue(result > 0, "Wrong CameraCount value for Camera"); } + [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; + } } } @@ -744,6 +1380,21 @@ namespace Tizen.Multimedia.Tests Assert.IsNotNull(TestCamera.Handle, "Failed to get Camera Handle."); } + [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.")] @@ -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 d7b6679f6..18df4da6a --- 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; @@ -227,6 +228,23 @@ namespace Tizen.Multimedia.Tests Assert.Greater(result.Count, 0, "The preview resolution 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.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")] @@ -242,6 +260,23 @@ namespace Tizen.Multimedia.Tests Assert.Greater(result.Count, 0, "The capture resolution 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.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")] @@ -257,6 +292,23 @@ namespace Tizen.Multimedia.Tests Assert.Greater(result.Count, 0, "The CaptureFormats 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.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")] @@ -272,6 +324,26 @@ namespace Tizen.Multimedia.Tests Assert.Greater(result.Count, 0, "The PreviewFormats 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.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")] @@ -287,6 +359,23 @@ namespace Tizen.Multimedia.Tests Assert.Greater(result.Count, 0, "The Fps 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.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")] @@ -297,12 +386,29 @@ 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")] @@ -321,6 +427,23 @@ namespace Tizen.Multimedia.Tests 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", "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")] @@ -336,6 +459,23 @@ namespace Tizen.Multimedia.Tests Assert.Greater(result.Count, 0, "The AfMode 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.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")] @@ -351,6 +491,23 @@ namespace Tizen.Multimedia.Tests Assert.Greater(result.Count, 0, "The ExposureMode 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.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")] @@ -366,6 +523,23 @@ namespace Tizen.Multimedia.Tests Assert.Greater(result.Count, 0, "The IsoLevel 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.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")] @@ -381,6 +555,23 @@ namespace Tizen.Multimedia.Tests Assert.Greater(result.Count, 0, "The TheaterMode 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.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")] @@ -396,6 +587,23 @@ namespace Tizen.Multimedia.Tests Assert.Greater(result.Count, 0, "The Whitebalance 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.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")] @@ -411,6 +619,23 @@ namespace Tizen.Multimedia.Tests Assert.Greater(result.Count, 0, "The FlashMode 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.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")] @@ -426,6 +651,23 @@ namespace Tizen.Multimedia.Tests Assert.Greater(result.Count, 0, "The SceneMode 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.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")] @@ -441,6 +683,23 @@ namespace Tizen.Multimedia.Tests Assert.Greater(result.Count, 0, "The Effect 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.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")] @@ -456,6 +715,23 @@ namespace Tizen.Multimedia.Tests Assert.Greater(result.Count, 0, "The StreamRotation 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.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")] @@ -471,6 +747,23 @@ namespace Tizen.Multimedia.Tests Assert.Greater(result.Count, 0, "The StreamFlip 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.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.")] @@ -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 0b5bbb365..4f4b57a1a --- 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 1693ac0e3..1b6ff6f77 --- 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 14c29406b..9ba1750b7 --- a/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraDisplaySettings.cs +++ b/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraDisplaySettings.cs @@ -32,6 +32,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.")] @@ -49,6 +117,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.")] @@ -65,6 +199,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("")] @@ -78,6 +280,40 @@ namespace Tizen.Multimedia.Tests Assert.IsTrue(TestCamera.DisplaySettings.Visible, "display visible is not same as set value."); } + [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.")] @@ -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 125886147..66d5de978 100644 --- a/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraSettings.cs +++ b/tct-suite-vs/Tizen.Camera.Tests/testcase/TSCameraSettings.cs @@ -57,6 +57,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.")] @@ -98,6 +129,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.")] @@ -146,6 +208,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.")] @@ -174,6 +251,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.")] @@ -199,6 +306,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.")] @@ -223,10 +345,40 @@ 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("")] @@ -248,10 +400,25 @@ 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("")] @@ -275,6 +442,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.")] @@ -294,6 +476,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.")] @@ -312,6 +509,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.")] @@ -329,6 +541,21 @@ namespace Tizen.Multimedia.Tests Assert.AreEqual(quality, TestCamera.Settings.ImageQuality, "The imagequality values 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.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)")] @@ -400,6 +627,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.")] @@ -433,6 +675,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.")] @@ -459,6 +716,21 @@ namespace Tizen.Multimedia.Tests Assert.AreEqual(level, TestCamera.Settings.ZoomLevel, "The zoomlevel 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.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.")] @@ -625,6 +897,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.")] @@ -643,6 +930,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.")] @@ -666,6 +968,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.")] @@ -684,6 +1001,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.")] @@ -702,6 +1034,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.")] @@ -725,6 +1072,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.")] @@ -748,6 +1110,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.")] @@ -771,6 +1148,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.")] @@ -789,6 +1188,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.")] @@ -807,6 +1221,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.")] @@ -825,6 +1254,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.")] @@ -843,6 +1287,21 @@ namespace Tizen.Multimedia.Tests Assert.IsFalse(TestCamera.Settings.EnableTag, "Enabletag 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.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.")] @@ -858,6 +1317,21 @@ namespace Tizen.Multimedia.Tests Assert.AreEqual(des, TestCamera.Settings.ImageDescriptionTag, "ImageDescription 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.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.")] @@ -873,6 +1347,21 @@ namespace Tizen.Multimedia.Tests Assert.AreEqual(des, TestCamera.Settings.SoftwareTag, "TagSoftware 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.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.")] @@ -895,6 +1384,21 @@ namespace Tizen.Multimedia.Tests Assert.AreEqual(loc.Altitude, TestCamera.Settings.GeoTag.Altitude, "GeoTag 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.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.")] @@ -909,6 +1413,21 @@ namespace Tizen.Multimedia.Tests Assert.AreEqual(CameraTagOrientation.TopLeft, TestCamera.Settings.OrientationTag, "Tag orientation should be same as set value."); } + [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.")] @@ -934,6 +1453,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.")] @@ -948,6 +1482,21 @@ namespace Tizen.Multimedia.Tests Assert.IsInstanceOf(result, "Orientation should be of type int."); } + [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.")] @@ -965,6 +1514,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.")] @@ -982,6 +1546,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.")] @@ -1003,6 +1582,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.")] @@ -1032,6 +1626,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.")] @@ -1061,6 +1670,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.")] @@ -1090,6 +1714,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.")] @@ -1116,6 +1755,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.")] @@ -1136,6 +1790,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.")] @@ -1156,6 +1825,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.")] @@ -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] @@ -1204,6 +1905,21 @@ namespace Tizen.Multimedia.Tests Assert.IsTrue(result.Width > 0 && result.Height > 0, "Recommended preview resolution should not be zero."); } + [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.")] @@ -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 8f559faf9..47adb1d4e --- 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 c580f7c1e..acf89431b --- 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 0cae55f02..4ea87ca74 --- 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 e57676f6b..e3dad2124 --- 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 358a50560..939c24a81 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"); + } } }