}
}
+ [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<ArgumentException>(() => 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<ArgumentException>(() => new Camera((CameraDevice)(CameraDevice.CameraDevice0 - 2)),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test GetDeviceState method for each specific state.")]
{
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;
+ }
}
}
[Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
public void GetDeviceState_THROWS_IF_PARAM_IS_INVALID()
{
- Assert.Throws<ArgumentException>(() => Camera.GetDeviceState(_invalidDevideNumber));
+ Assert.Throws<ArgumentException>(() => Camera.GetDeviceState(_invalidDevideNumber),
+ "Should throws proper exception");
}
[Test]
[Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
public void ChangeDevice_THROWS_IF_PARAM_IS_INVALID()
{
- Assert.Throws<ArgumentException>(() => TestCamera.ChangeDevice(_invalidDevideNumber));
+ Assert.Throws<ArgumentException>(() => 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<CameraStateChangedEventArgs>.Create())
+ {
+ TestCamera.StateChanged += eventWaiter;
+
+ try
+ {
+ TestCamera.StartPreview();
+ await eventWaiter.IsRaisedAsync();
+ }
+ finally
+ {
+ TestCamera.StateChanged -= eventWaiter;
+ }
+
+ }
+
+ Assert.Throws<InvalidOperationException>(() => 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<ObjectDisposedException>(() => 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<CameraStateChangedEventArgs>.Create())
+ {
+ TestCamera.StateChanged += eventWaiter;
+
+ try
+ {
+ TestCamera.StartPreview();
+ await eventWaiter.IsRaisedAsync();
+ }
+ finally
+ {
+ TestCamera.StateChanged -= eventWaiter;
+ }
+ }
+
+ Assert.Throws<InvalidOperationException>(() => 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<ObjectDisposedException>(() => TestCamera.StartPreview(),
+ "Should throws proper exception");
}
[Test]
{
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<InvalidOperationException>(() => 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<ObjectDisposedException>(() => TestCamera.StopPreview(),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test the StopContinuousCapture method.")]
{
TestCamera.StartPreview();
- using (var completeWaiter = EventAwaiter<CameraCapturingEventArgs>.Create())
using (var tokenSource = new CancellationTokenSource())
{
- try
+ using (var completeWaiter = EventAwaiter<CameraCapturingEventArgs>.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<CameraStateChangedEventArgs>.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));
}
}
+ [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<InvalidOperationException>(() => 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<ObjectDisposedException>(() => 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<InvalidOperationException>(() => 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<ObjectDisposedException>(() => 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<CameraStateChangedEventArgs>.Create())
+ {
+ TestCamera.StateChanged += eventWaiter;
+
+ try
+ {
+ TestCamera.StartPreview();
+ await eventWaiter.IsRaisedAsync();
+ }
+ finally
+ {
+ TestCamera.StateChanged -= eventWaiter;
+ }
+ }
+
+ Assert.Throws<ArgumentOutOfRangeException>(() => 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<CameraStateChangedEventArgs>.Create())
+ {
+ TestCamera.StateChanged += eventWaiter;
+
+ try
+ {
+ TestCamera.StartPreview();
+ await eventWaiter.IsRaisedAsync();
+ }
+ finally
+ {
+ TestCamera.StateChanged -= eventWaiter;
+ }
+ }
+
+ Assert.Throws<ArgumentOutOfRangeException>(() => TestCamera.StartCapture(3, -1, CancellationToken.None),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test StopFaceDetection method. The method should work without any exception.")]
}
}
+ [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<ObjectDisposedException>(() => 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<ObjectDisposedException>(() => TestCamera.StartFaceDetection(),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test CancelFocusing method. The method should work without any 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_TRUE_WITH_STATE_IS_INVALID()
+ {
+ Assert.Throws<InvalidOperationException>(() => 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<InvalidOperationException>(() => 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<ObjectDisposedException>(() => 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<ObjectDisposedException>(() => 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<InvalidOperationException>(() => 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<ObjectDisposedException>(() => TestCamera.StopFocusing(),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test all available camera state.")]
Assert.That(TestCamera.State, Is.EqualTo(CameraState.Created));
TestCamera.StartPreview();
+
Assert.That(TestCamera.State, Is.EqualTo(CameraState.Preview));
using (var eventWaiter = EventAwaiter<EventArgs>.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<ObjectDisposedException>(() => state = TestCamera.State,
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test DisplayReuseHint property whether it is set correctly or not.")]
{
TestCamera.StateChanged += eventWaiter;
- TestCamera.StartPreview();
-
- await eventWaiter.IsRaisedAsync();
+ try
+ {
+ TestCamera.StartPreview();
+ await eventWaiter.IsRaisedAsync();
+ }
+ finally
+ {
+ TestCamera.StateChanged -= eventWaiter;
+ }
}
TestCamera.DisplayReuseHint = true;
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<InvalidOperationException>(() => 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<ObjectDisposedException>(() => TestCamera.DisplayReuseHint = true,
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test Setting property of the camera.")]
Assert.IsInstanceOf<CameraFacingDirection>(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<ObjectDisposedException>(() => direction = TestCamera.Direction,
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test Flash state property of the camera.")]
}
}
+ [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.")]
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<ObjectDisposedException>(() => 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")]
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;
+ }
}
}
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;
+ }
}
}
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;
+ }
}
}
{
TestCamera.StateChanged += eventWaiter;
- TestCamera.StartPreview();
+ try
+ {
+ TestCamera.StartPreview();
- Assert.That(await eventWaiter.IsRaisedAsync());
+ Assert.That(await eventWaiter.IsRaisedAsync());
+ }
+ finally
+ {
+ TestCamera.StateChanged -= eventWaiter;
+ }
}
}
{
Camera.DeviceStateChanged += eventWaiter;
- TestCamera.StartPreview();
+ try
+ {
+ TestCamera.StartPreview();
- Assert.That(await eventWaiter.IsRaisedAsync());
+ Assert.That(await eventWaiter.IsRaisedAsync());
+ }
+ finally
+ {
+ Camera.DeviceStateChanged -= eventWaiter;
+ }
}
}
{
Assert.Fail("Exception is occured. msg : " + ex.ToString());
}
+ finally
+ {
+ TestCamera.Interrupted -= eventWaiter;
+ }
}
}
{
try
{
- TestCamera.InterruptStarted += (s, e) => { };
+ TestCamera.InterruptStarted += eventWaiter;
}
catch (Exception ex)
{
Assert.Fail("Exception is occured. msg : " + ex.ToString());
}
+ finally
+ {
+ TestCamera.InterruptStarted -= eventWaiter;
+ }
}
}
{
try
{
- TestCamera.ErrorOccurred += (s, e) => { };
+ TestCamera.ErrorOccurred += eventWaiter;
}
catch (Exception ex)
{
Assert.Fail("Exception is occured. msg : " + ex.ToString());
}
+ finally
+ {
+ TestCamera.ErrorOccurred -= eventWaiter;
+ }
}
}
{
TestCamera.StateChanged += eventWaiter;
- TestCamera.StartPreview();
+ try
+ {
+ TestCamera.StartPreview();
- Assert.That(await eventWaiter.IsRaisedAsync());
+ Assert.That(await eventWaiter.IsRaisedAsync());
+ }
+ finally
+ {
+ TestCamera.StateChanged -= eventWaiter;
+ }
}
}
{
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;
+ }
}
}
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<ObjectDisposedException>(() => { 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.")]
{
TestCamera.Dispose();
- Assert.Throws<ObjectDisposedException>(() => { IntPtr handle = TestCamera.Handle; });
+ Assert.Throws<ObjectDisposedException>(() => { IntPtr handle = TestCamera.Handle; },
+ "Should throws proper exception");
}
}
}
// you entered into with Samsung.
using NUnit.Framework;
+using System;
using System.Linq;
using System.Collections;
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<ObjectDisposedException>(() =>
+ {
+ var result = TestCamera.Capabilities.SupportedPreviewResolutions;
+ }, "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test CaptureResolutions supported property. Supported list should be greater than 0")]
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<ObjectDisposedException>(() =>
+ {
+ var result = TestCamera.Capabilities.SupportedCaptureResolutions;
+ }, "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test CaptureFormats supported property. Supported list should be greater than 0")]
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<ObjectDisposedException>(() =>
+ {
+ var result = TestCamera.Capabilities.SupportedCapturePixelFormats;
+ }, "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test PreviewFormats supported property. Supported list should be greater than 0")]
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<ObjectDisposedException>(() =>
+ {
+ var result = camera.Capabilities.SupportedPreviewPixelFormats;
+ }, "Should throws proper exception");
+ }
+ }
+
[Test]
[Category("P1")]
[Description("Test Supported Fps property. Supported list should be greater than 0")]
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<ObjectDisposedException>(() =>
+ {
+ var result = TestCamera.Capabilities.SupportedPreviewFps;
+ }, "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test Supported FpsByResolution method. Supported list should be greater than 0")]
[Property("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<ObjectDisposedException>(() =>
+ TestCamera.Capabilities.GetSupportedPreviewFpsByResolution(640, 480),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test Supported FpsByResolution method. Supported list should be greater than 0")]
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<ObjectDisposedException>(() =>
+ 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")]
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<ObjectDisposedException>(() =>
+ {
+ var modes = TestCamera.Capabilities.SupportedAutoFocusModes;
+ }, "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test Supported ExposureModes property. Supported list should be greater than 0")]
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<ObjectDisposedException>(() =>
+ {
+ var modes = TestCamera.Capabilities.SupportedExposureModes;
+ }, "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test Supported IsoLevel property. Supported list should be greater than 0")]
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<ObjectDisposedException>(() =>
+ {
+ var levels = TestCamera.Capabilities.SupportedIsoLevels;
+ }, "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test Supported TheaterMode property. Supported list should be greater than 0")]
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<ObjectDisposedException>(() =>
+ {
+ var modes = TestCamera.Capabilities.SupportedTheaterModes;
+ }, "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test Supported Whitebalance property. Supported list should be greater than 0")]
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<ObjectDisposedException>(() =>
+ {
+ var whiteBalances = TestCamera.Capabilities.SupportedWhiteBalances;
+ }, "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test Supported FlashMode property. Supported list should be greater than 0")]
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<ObjectDisposedException>(() =>
+ {
+ var modes = TestCamera.Capabilities.SupportedFlashModes;
+ }, "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test Supported SceneMode property. Supported list should be greater than 0")]
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<ObjectDisposedException>(() =>
+ {
+ var modes = TestCamera.Capabilities.SupportedSceneModes;
+ }, "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test supported Effect property. Supported list should be greater than 0")]
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<ObjectDisposedException>(() =>
+ {
+ var effects = TestCamera.Capabilities.SupportedEffects;
+ }, "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test supported StreamRotation property. Supported list should be greater than 0")]
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<ObjectDisposedException>(() =>
+ {
+ var rotations = TestCamera.Capabilities.SupportedStreamRotations;
+ }, "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test supported StreamFlip property. Supported list should be greater than 0")]
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<ObjectDisposedException>(() =>
+ {
+ var flips = TestCamera.Capabilities.SupportedStreamFlips;
+ }, "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test supported PtzType property.")]
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<ObjectDisposedException>(() =>
+ {
+ var types = TestCamera.Capabilities.SupportedPtzTypes;
+ }, "Should throws proper exception");
+ }
}
}
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;
+ }
}
}
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;
+ }
}
}
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;
+ }
}
}
}
{
Camera.DeviceStateChanged += eventWaiter;
- TestCamera.StartPreview();
+ try
+ {
+ TestCamera.StartPreview();
- Assert.That(await eventWaiter.IsRaisedAsync());
+ Assert.That(await eventWaiter.IsRaisedAsync());
+ }
+ finally
+ {
+ Camera.DeviceStateChanged -= eventWaiter;
+ }
}
}
}
}
}
+ [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<ObjectDisposedException>(() =>
+ {
+ 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<ObjectDisposedException>(() =>
+ {
+ 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<ArgumentException>(() =>
+ {
+ 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<ArgumentException>(() =>
+ {
+ TestCamera.DisplaySettings.Rotation = Rotation.Rotate0 - 1;
+ }, "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test Flip property of CameraDisplaySettings class.")]
}
}
+ [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<ObjectDisposedException>(() =>
+ {
+ 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<ObjectDisposedException>(() =>
+ {
+ 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<ArgumentException>(() =>
+ {
+ 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<ArgumentException>(() =>
+ {
+ TestCamera.DisplaySettings.Flip = Flips.None - 1;
+ }, "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test mode property of CameraDisplaySettings class.")]
}
}
+ [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<ObjectDisposedException>(() =>
+ {
+ 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<ObjectDisposedException>(() =>
+ {
+ 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<ArgumentException>(() =>
+ {
+ 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<ArgumentException>(() =>
+ {
+ TestCamera.DisplaySettings.Mode = CameraDisplayMode.LetterBox - 1;
+ }, "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("")]
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<ObjectDisposedException>(() =>
+ {
+ 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<ObjectDisposedException>(() =>
+ {
+ TestCamera.DisplaySettings.Visible = true;
+ }, "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test DisplayRoiArea property.")]
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<ObjectDisposedException>(() =>
+ {
+ 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<ObjectDisposedException>(() =>
+ {
+ TestCamera.DisplaySettings.RoiArea = new Rectangle(0, 0, 100, 100);
+ }, "Should throws proper exception");
+ }
}
}
}
}
+ [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<ArgumentException>(() => TestCamera.Settings.SetAutoFocusArea(100, -1));
+ Assert.Throws<ArgumentException>(() => TestCamera.Settings.SetAutoFocusArea(-1, 100));
+ Assert.Throws<ArgumentException>(() => 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<ObjectDisposedException>(() => TestCamera.Settings.SetAutoFocusArea(100, 100),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test SetFocusArea method.")]
}
}
+ [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<ArgumentException>(() => TestCamera.Settings.SetAutoFocusArea(new Point(100, -1)));
+ Assert.Throws<ArgumentException>(() => TestCamera.Settings.SetAutoFocusArea(new Point(-1, 100)));
+ Assert.Throws<ArgumentException>(() => 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<ObjectDisposedException>(() => TestCamera.Settings.SetAutoFocusArea(new Point(100, 100)),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test ClearFocusArea method.")]
}
}
+ [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<ObjectDisposedException>(() => TestCamera.Settings.ClearFocusArea(),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test SetPan method.")]
}
}
+ [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<ObjectDisposedException>(() => 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<ArgumentException>(() => TestCamera.Settings.SetPan(CameraPtzMoveType.Absoulute - 1, 10),
+ "Should throws proper exception");
+ Assert.Throws<ArgumentException>(() => TestCamera.Settings.SetPan(CameraPtzMoveType.Relative + 1, 10),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P0")]
[Description("Test GetPan property.")]
}
}
+ [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<ObjectDisposedException>(() => TestCamera.Settings.GetPan(),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test SetTilt Property.")]
}
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<ObjectDisposedException>(() => 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<ArgumentException>(() => TestCamera.Settings.SetTilt(CameraPtzMoveType.Absoulute - 1, 10),
+ "Should throws proper exception");
+ Assert.Throws<ArgumentException>(() => TestCamera.Settings.SetTilt(CameraPtzMoveType.Relative + 1, 10),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P0")]
[Description("")]
}
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<ObjectDisposedException>(() => TestCamera.Settings.GetTilt(),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("")]
}
}
+ [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<ObjectDisposedException>(() => TestCamera.Settings.RemoveGeoTag(),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test DisableShutterSound method.")]
}
}
+ [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<ObjectDisposedException>(() => TestCamera.Settings.DisableShutterSound(true),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test PreviewFps property.")]
}
}
+ [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<ObjectDisposedException>(() => { var fps = TestCamera.Settings.PreviewFps; },
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test ImageQuality property.")]
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<ObjectDisposedException>(() => { var quality = TestCamera.Settings.ImageQuality; },
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test ImageQuality property. Check value for out of bound.(Below Min)")]
}
}
+ [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<ObjectDisposedException>(() => { var bitrate = TestCamera.Settings.EncodedPreviewBitrate; },
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test Encodedpreviewgop interval property.")]
}
}
+ [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<ObjectDisposedException>(() => { var gopInterval = TestCamera.Settings.EncodedPreviewGopInterval; },
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test zoomlevel property.")]
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<ObjectDisposedException>(() => { var level = TestCamera.Settings.ZoomLevel; },
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test zoom range property.")]
}
}
+ [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<ObjectDisposedException>(() => { var mode = TestCamera.Settings.AutoFocusMode; },
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test ExposureMode property.")]
}
}
+ [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<ObjectDisposedException>(() => { var mode = TestCamera.Settings.ExposureMode; },
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test Exposure property.")]
}
}
+ [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<ObjectDisposedException>(() => { var exposure = TestCamera.Settings.Exposure; },
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test IsoLevel property.")]
}
}
+ [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<ObjectDisposedException>(() => { var level = TestCamera.Settings.IsoLevel; },
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test TheaterMode property.")]
}
}
+ [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<ObjectDisposedException>(() => { var mode = TestCamera.Settings.TheaterMode; },
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test Brightness property.")]
}
}
+ [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<ObjectDisposedException>(() => { var brightness = TestCamera.Settings.Brightness; },
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test Contrast property.")]
}
}
+ [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<ObjectDisposedException>(() => { var contrast = TestCamera.Settings.Contrast; },
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test Hue property.")]
}
}
+ [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<ObjectDisposedException>(() => { 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.")]
}
}
+ [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<ObjectDisposedException>(() => { var wb = TestCamera.Settings.WhiteBalance; },
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test Effect setting.")]
}
}
+ [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<ObjectDisposedException>(() => { var effect = TestCamera.Settings.Effect; },
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test SceneMode setting.")]
}
}
+ [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<ObjectDisposedException>(() => { var mode = TestCamera.Settings.SceneMode; },
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test EnableTag property.")]
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<ObjectDisposedException>(() => { var rag = TestCamera.Settings.EnableTag; },
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test ImageDescriptionTag property.")]
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<ObjectDisposedException>(() => { var tag = TestCamera.Settings.ImageDescriptionTag; },
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test SoftwareTag property.")]
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<ObjectDisposedException>(() => { var tag = TestCamera.Settings.SoftwareTag; },
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test GeoTag property.")]
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<ObjectDisposedException>(() => { var tag = TestCamera.Settings.GeoTag; },
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test OrientationTag property.")]
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<ObjectDisposedException>(() => { var tag = TestCamera.Settings.OrientationTag; },
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test FlashMode property.")]
}
}
+ [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<ObjectDisposedException>(() => { var mode = TestCamera.Settings.FlashMode; },
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test LensOrientation property.")]
Assert.IsInstanceOf<int>(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<ObjectDisposedException>(() => { var orientation = TestCamera.Settings.LensOrientation; },
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test StreamRotation property.")]
}
}
+ [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<ObjectDisposedException>(() => { var rotation = TestCamera.Settings.StreamRotation; },
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test StreamFlip property.")]
}
}
+ [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<ObjectDisposedException>(() => { var flip = TestCamera.Settings.StreamFlip; },
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test HdrMode property.")]
}
}
+ [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<ObjectDisposedException>(() => { var mode = TestCamera.Settings.HdrMode; },
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test Antishake property.")]
}
}
+ [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<ObjectDisposedException>(() => { var antiShake = TestCamera.Settings.AntiShake; },
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test VideoStabilization property.")]
}
}
+ [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<ObjectDisposedException>(() => { var vs = TestCamera.Settings.VideoStabilization; },
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test Autocontrast property.")]
}
}
+ [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<ObjectDisposedException>(() => { var contrast = TestCamera.Settings.AutoContrast; },
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test PtzType.")]
}
}
+ [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<ObjectDisposedException>(() => { TestCamera.Settings.PtzType = CameraPtzType.Electronic; },
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test capture format property of the camera.")]
}
}
+ [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<ObjectDisposedException>(() => { var format = TestCamera.Settings.CapturePixelFormat; },
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test preview format property of the camera.")]
}
}
+ [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<ObjectDisposedException>(() => { var format = TestCamera.Settings.PreviewPixelFormat; },
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test PreviewResolution property of camera.")]
public void PreviewResolution_THROWS_EXCEPTION_IF_PARAM_IS_INVALID()
{
// Param is out of range.
- Assert.Throws<ArgumentException>(() => TestCamera.Settings.PreviewResolution = new Size(-1, -1));
+ Assert.Throws<ArgumentException>(() => TestCamera.Settings.PreviewResolution = new Size(-1, -1),
+ "Should throws proper exception");
// Not supported resolution matching.
- Assert.Throws<NotSupportedException>(() => TestCamera.Settings.PreviewResolution = new Size(640, 481));
+ Assert.Throws<NotSupportedException>(() => 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<ObjectDisposedException>(() => { var resolution = TestCamera.Settings.PreviewResolution; },
+ "Should throws proper exception");
}
[Test]
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<ObjectDisposedException>(() => { var resolution = TestCamera.Settings.RecommendedPreviewResolution; },
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test capture resolution of the camera.")]
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<ObjectDisposedException>(() => { var resolution = TestCamera.Settings.CaptureResolution; },
+ "Should throws proper exception");
+ }
}
}
{
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;
+ }
}
}
{
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;
+ }
}
}
{
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;
+ }
}
}
}
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;
+ }
}
}
}
{
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;
+ }
}
}
}
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;
+ }
}
}
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;
+ }
}
}
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;
+ }
}
}
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;
+ }
}
}
}
// 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
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<CameraStateChangedEventArgs>.Create())
+ {
+ TestCamera.StateChanged += eventWaiter;
+
+ try
+ {
+ TestCamera.StartPreview();
+ await eventWaiter.IsRaisedAsync();
+ }
+ finally
+ {
+ TestCamera.StateChanged -= eventWaiter;
+ }
+ }
+
+ Assert.Throws<InvalidOperationException>(() =>
+ 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<ObjectDisposedException>(() =>
+ TestCamera.Display = new Display(new Window("test")),
+ "Should throws proper exception");
+ }
}
}