3 using NUnit.Framework.TUnit;
4 using Tizen.NUI.Components;
5 using Tizen.NUI.BaseComponents;
6 using System.Collections.Generic;
9 namespace Tizen.NUI.Devel.Tests
11 using tlog = Tizen.Log;
14 [Description("public/Utility/Capture")]
15 class PublicCaptureTest
17 private const string tag = "NUITEST";
18 private string path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";
19 private string jpg_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "arrow.jpg";
21 private delegate bool dummyCallback(IntPtr captureSignal);
22 private bool OnDummyCallback(IntPtr data)
28 internal class MyCapture : Capture
30 public MyCapture() : base()
33 public void OnDispose(DisposeTypes type)
42 tlog.Info(tag, "Init() is called!");
48 tlog.Info(tag, "Destroy() is called!");
53 [Description("Capture constructor.")]
54 [Property("SPEC", "Tizen.NUI.Capture.Capture C")]
55 [Property("SPEC_URL", "-")]
56 [Property("CRITERIA", "CONSTR")]
57 [Property("AUTHOR", "guowei.wang@samsung.com")]
58 public void CaptureConstructor()
60 tlog.Debug(tag, $"CaptureConstructor START");
62 var testingTarget = new Capture();
63 Assert.IsNotNull(testingTarget, "Can't create success object Capture");
64 Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
66 testingTarget.Dispose();
67 tlog.Debug(tag, $"CaptureConstructor END (OK)");
72 [Description("Capture Dispose.")]
73 [Property("SPEC", "Tizen.NUI.Capture.Dispose M")]
74 [Property("SPEC_URL", "-")]
75 [Property("CRITERIA", "MR")]
76 [Property("AUTHOR", "guowei.wang@samsung.com")]
77 public void CaptureDispose()
79 tlog.Debug(tag, $"CaptureDispose START");
81 var testingTarget = new Capture();
82 Assert.IsNotNull(testingTarget, "Can't create success object Capture");
83 Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
87 testingTarget.Dispose();
91 tlog.Debug(tag, e.Message.ToString());
92 Assert.Fail("Caught Exception: Failed!");
95 /** disposed is true */
98 testingTarget.Dispose();
102 tlog.Debug(tag, e.Message.ToString());
103 Assert.Fail("Caught Exception: Failed!");
106 tlog.Debug(tag, $"CaptureDispose END (OK)");
111 [Description("Capture SetImageQuality.")]
112 [Property("SPEC", "Tizen.NUI.Capture.SetImageQuality M")]
113 [Property("SPEC_URL", "-")]
114 [Property("CRITERIA", "MR")]
115 [Property("AUTHOR", "guowei.wang@samsung.com")]
116 public void CaptureSetImageQuality()
118 tlog.Debug(tag, $"CaptureSetImageQuality START");
120 var testingTarget = new Capture();
121 Assert.IsNotNull(testingTarget, "Can't create success object Capture");
122 Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
126 testingTarget.SetImageQuality(30);
130 tlog.Debug(tag, e.Message.ToString());
131 Assert.Fail("Caught Exception: Failed!");
134 testingTarget.Dispose();
135 tlog.Debug(tag, $"CaptureSetImageQuality END (OK)");
140 [Description("Capture SetImageQuality. With invalid operation.")]
141 [Property("SPEC", "Tizen.NUI.Capture.SetImageQuality M")]
142 [Property("SPEC_URL", "-")]
143 [Property("CRITERIA", "MR")]
144 [Property("AUTHOR", "guowei.wang@samsung.com")]
145 public void CaptureSetImageQualityWithInvalidOperation()
147 tlog.Debug(tag, $"CaptureSetImageQualityWithInvalidOperation START");
149 var testingTarget = new Capture();
150 Assert.IsNotNull(testingTarget, "Can't create success object Capture");
151 Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
155 testingTarget.SetImageQuality(120);
157 catch (InvalidOperationException)
159 testingTarget.Dispose();
160 tlog.Debug(tag, $"CaptureSetImageQualityWithInvalidOperation END (OK)");
161 Assert.Pass("Caught InvalidOperationException: Passed!");
167 [Description("Capture Dispose. Capture is disposed.")]
168 [Property("SPEC", "Tizen.NUI.Capture.Dispose M")]
169 [Property("SPEC_URL", "-")]
170 [Property("CRITERIA", "MR")]
171 [Property("AUTHOR", "guowei.wang@samsung.com")]
172 public void CaptureDisposeWithDisposedInstance()
174 tlog.Debug(tag, $"CaptureDisposeWithDisposedInstance START");
176 var testingTarget = new MyCapture();
177 Assert.IsNotNull(testingTarget, "Can't create success object MyCapture");
178 Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of MyCapture type.");
180 testingTarget.OnDispose(DisposeTypes.Explicit);
184 testingTarget.OnDispose(DisposeTypes.Explicit);
188 tlog.Debug(tag, e.Message.ToString());
189 Assert.Fail("Caught Exception: Failed!");
192 tlog.Debug(tag, $"CaptureDisposeWithDisposedInstance END (OK)");
197 [Description("Capture Start.")]
198 [Property("SPEC", "Tizen.NUI.Capture.Start M")]
199 [Property("SPEC_URL", "-")]
200 [Property("CRITERIA", "MR")]
201 [Property("AUTHOR", "guowei.wang@samsung.com")]
202 public void CaptureStart()
204 tlog.Debug(tag, $"CaptureStart START");
206 var testingTarget = new Capture();
207 Assert.IsNotNull(testingTarget, "Can't create success object Capture");
208 Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
210 using (Container container = new View())
212 using (Size size = new Size(100, 80))
216 testingTarget.Start(container, size, path);
220 tlog.Debug(tag, e.Message.ToString());
221 Assert.Fail("Caught Exception: Failed!");
226 testingTarget.Dispose();
227 tlog.Debug(tag, $"CaptureStart END (OK)");
232 [Description("Capture Start. Size is null.")]
233 [Property("SPEC", "Tizen.NUI.Capture.Start M")]
234 [Property("SPEC_URL", "-")]
235 [Property("CRITERIA", "MR")]
236 [Property("AUTHOR", "guowei.wang@samsung.com")]
237 public void CaptureStartWithNullSize()
239 tlog.Debug(tag, $"CaptureStartWithNullSize START");
241 var testingTarget = new Capture();
242 Assert.IsNotNull(testingTarget, "Can't create success object Capture");
243 Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
245 using (Container container = new View())
249 testingTarget.Start(container, null, path);
251 catch (ArgumentNullException e)
253 testingTarget.Dispose();
254 tlog.Debug(tag, e.Message.ToString());
255 tlog.Debug(tag, $"CaptureStartWithNullSize END (OK)");
256 Assert.Pass("Caught ArgumentNullException: Passed!");
263 [Description("Capture Start. Size is invalid.")]
264 [Property("SPEC", "Tizen.NUI.Capture.Start M")]
265 [Property("SPEC_URL", "-")]
266 [Property("CRITERIA", "MR")]
267 [Property("AUTHOR", "guowei.wang@samsung.com")]
268 public void CaptureStartWithInvalidSize()
270 tlog.Debug(tag, $"CaptureStartWithInvalidSize START");
272 var testingTarget = new Capture();
273 Assert.IsNotNull(testingTarget, "Can't create success object Capture");
274 Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
276 using (Container container = new View())
278 using (Size size = new Size(0, 0))
282 testingTarget.Start(container, size, path);
284 catch (InvalidOperationException e)
286 testingTarget.Dispose();
287 tlog.Debug(tag, e.Message.ToString());
288 tlog.Debug(tag, $"CaptureStartWithInvalidSize END (OK)");
289 Assert.Pass("Caught InvalidOperationException: Passed!");
297 [Description("Capture Start. path is null.")]
298 [Property("SPEC", "Tizen.NUI.Capture.Start M")]
299 [Property("SPEC_URL", "-")]
300 [Property("CRITERIA", "MR")]
301 [Property("AUTHOR", "guowei.wang@samsung.com")]
302 public void CaptureStartWithNullPath()
304 tlog.Debug(tag, $"CaptureStartWithNullPath START");
306 var testingTarget = new Capture();
307 Assert.IsNotNull(testingTarget, "Can't create success object Capture");
308 Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
310 using (Container container = new View())
312 using (Size size = new Size(100, 80))
316 testingTarget.Start(container, size, null);
318 catch (ArgumentNullException e)
320 testingTarget.Dispose();
321 tlog.Debug(tag, e.Message.ToString());
322 tlog.Debug(tag, $"CaptureStartWithNullPath END (OK)");
323 Assert.Pass("Caught ArgumentNullException: Passed!");
331 [Description("Capture Start include Color.")]
332 [Property("SPEC", "Tizen.NUI.Capture.Start M")]
333 [Property("SPEC_URL", "-")]
334 [Property("CRITERIA", "MR")]
335 [Property("AUTHOR", "guowei.wang@samsung.com")]
336 public void CaptureStartIncludeColor()
338 tlog.Debug(tag, $"CaptureStartIncludeColor START");
340 var testingTarget = new Capture();
341 Assert.IsNotNull(testingTarget, "Can't create success object Capture");
342 Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
344 using (Container container = new View())
346 using (Size size = new Size(100, 80))
348 using (Color color = Color.Cyan)
352 testingTarget.Start(container, size, path, color);
356 tlog.Debug(tag, e.Message.ToString());
357 Assert.Fail("Caught Exception: Failed!");
363 testingTarget.Dispose();
364 tlog.Debug(tag, $"CaptureStartIncludeColor END (OK)");
369 [Description("Capture Start include Color. Color is null.")]
370 [Property("SPEC", "Tizen.NUI.Capture.Start M")]
371 [Property("SPEC_URL", "-")]
372 [Property("CRITERIA", "MR")]
373 [Property("AUTHOR", "guowei.wang@samsung.com")]
374 public void CaptureStartIncludeColorWithNullColor()
376 tlog.Debug(tag, $"CaptureStartIncludeColorWithNullColor START");
378 var testingTarget = new Capture();
379 Assert.IsNotNull(testingTarget, "Can't create success object Capture");
380 Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
382 using (Container container = new View())
384 using (Size size = new Size(100, 80))
388 testingTarget.Start(container, size, path, null);
390 catch (ArgumentNullException e)
392 testingTarget.Dispose();
393 tlog.Debug(tag, e.Message.ToString());
394 tlog.Debug(tag, $"CaptureStartIncludeColorWithNullColor END (OK)");
395 Assert.Pass("Caught ArgumentNullException: Passed!");
403 [Description("Capture Start include color. Size is null.")]
404 [Property("SPEC", "Tizen.NUI.Capture.Start M")]
405 [Property("SPEC_URL", "-")]
406 [Property("CRITERIA", "MR")]
407 [Property("AUTHOR", "guowei.wang@samsung.com")]
408 public void CaptureStartIncludeColorWithNullSize()
410 tlog.Debug(tag, $"CaptureStartIncludeColorWithNullSize START");
412 var testingTarget = new Capture();
413 Assert.IsNotNull(testingTarget, "Can't create success object Capture");
414 Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
416 using (Container container = new View())
418 using (Color color = Color.Cyan)
422 testingTarget.Start(container, null, path, color);
424 catch (ArgumentNullException e)
426 testingTarget.Dispose();
427 tlog.Debug(tag, e.Message.ToString());
428 tlog.Debug(tag, $"CaptureStartIncludeColorWithNullSize END (OK)");
429 Assert.Pass("Caught ArgumentNullException: Passed!");
437 [Description("Capture Start include color. Path is null.")]
438 [Property("SPEC", "Tizen.NUI.Capture.Start M")]
439 [Property("SPEC_URL", "-")]
440 [Property("CRITERIA", "MR")]
441 [Property("AUTHOR", "guowei.wang@samsung.com")]
442 public void CaptureStartIncludeColorWithNullPath()
444 tlog.Debug(tag, $"CaptureStartIncludeColorWithNullPath START");
446 var testingTarget = new Capture();
447 Assert.IsNotNull(testingTarget, "Can't create success object Capture");
448 Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
450 using (Container container = new View())
452 using (Size size = new Size(100, 80))
454 using (Color color = Color.Cyan)
458 testingTarget.Start(container, size, null, color);
460 catch (ArgumentNullException e)
462 testingTarget.Dispose();
463 tlog.Debug(tag, e.Message.ToString());
464 tlog.Debug(tag, $"CaptureStartIncludeColorWithNullPath END (OK)");
465 Assert.Pass("Caught ArgumentNullException: Passed!");
474 [Description("Capture Start include color. Size is invalid.")]
475 [Property("SPEC", "Tizen.NUI.Capture.Start M")]
476 [Property("SPEC_URL", "-")]
477 [Property("CRITERIA", "MR")]
478 [Property("AUTHOR", "guowei.wang@samsung.com")]
479 public void CaptureStartIncludeColorWithInvalidSize()
481 tlog.Debug(tag, $"CaptureStartIncludeColorWithInvalidSize START");
483 var testingTarget = new Capture();
484 Assert.IsNotNull(testingTarget, "Can't create success object Capture");
485 Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
487 using (Container container = new View())
489 using (Size size = new Size(0, 0))
491 using (Color color = Color.Cyan)
495 testingTarget.Start(container, size, path, color);
497 catch (InvalidOperationException e)
499 testingTarget.Dispose();
500 tlog.Debug(tag, e.Message.ToString());
501 tlog.Debug(tag, $"CaptureStartIncludeColorWithInvalidSize END (OK)");
502 Assert.Pass("Caught InvalidOperationException: Passed!");
511 //[Description("Capture Start include quality.")]
512 //[Property("SPEC", "Tizen.NUI.Capture.Start M")]
513 //[Property("SPEC_URL", "-")]
514 //[Property("CRITERIA", "MR")]
515 //[Property("AUTHOR", "guowei.wang@samsung.com")]
516 //public void CaptureStartIncludeQuality()
518 // tlog.Debug(tag, $"CaptureStartIncludeQuality START");
520 // var testingTarget = new Capture();
521 // Assert.IsNotNull(testingTarget, "Can't create success object Capture");
522 // Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
524 // using (Container container = new View())
526 // using (Size size = new Size(100, 80))
528 // using (Color color = Color.Cyan)
532 // testingTarget.Start(container, size, jpg_path, color, 30);
534 // catch (Exception e)
536 // tlog.Debug(tag, e.Message.ToString());
537 // Assert.Fail("Caught Exception: Failed!");
543 // testingTarget.Dispose();
544 // tlog.Debug(tag, $"CaptureStartIncludeQuality END (OK)");
549 [Description("Capture Start include quality. Color is null.")]
550 [Property("SPEC", "Tizen.NUI.Capture.Start M")]
551 [Property("SPEC_URL", "-")]
552 [Property("CRITERIA", "MR")]
553 [Property("AUTHOR", "guowei.wang@samsung.com")]
554 public void CaptureStartIncludeQualityWithNullColor()
556 tlog.Debug(tag, $"CaptureStartIncludeQualityWithNullColor START");
558 var testingTarget = new Capture();
559 Assert.IsNotNull(testingTarget, "Can't create success object Capture");
560 Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
562 using (Container container = new View())
564 using (Size size = new Size(100, 80))
568 testingTarget.Start(container, size, jpg_path, null, 30);
570 catch (ArgumentNullException e)
572 testingTarget.Dispose();
573 tlog.Debug(tag, e.Message.ToString());
574 tlog.Debug(tag, $"CaptureStartIncludeQualityWithNullColor END (OK)");
575 Assert.Pass("Caught ArgumentNullException: Passed!");
583 [Description("Capture Start include quality. Size is null.")]
584 [Property("SPEC", "Tizen.NUI.Capture.Start M")]
585 [Property("SPEC_URL", "-")]
586 [Property("CRITERIA", "MR")]
587 [Property("AUTHOR", "guowei.wang@samsung.com")]
588 public void CaptureStartIncludeQualityWithNullSize()
590 tlog.Debug(tag, $"CaptureStartIncludeQualityWithNullSize START");
592 var testingTarget = new Capture();
593 Assert.IsNotNull(testingTarget, "Can't create success object Capture");
594 Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
596 using (Container container = new View())
598 using (Color color = Color.Cyan)
602 testingTarget.Start(container, null, jpg_path, color, 30);
604 catch (ArgumentNullException e)
606 testingTarget.Dispose();
607 tlog.Debug(tag, e.Message.ToString());
608 tlog.Debug(tag, $"CaptureStartIncludeQualityWithNullSize END (OK)");
609 Assert.Pass("Caught ArgumentNullException: Passed!");
617 [Description("Capture Start include quality. Path is null.")]
618 [Property("SPEC", "Tizen.NUI.Capture.Start M")]
619 [Property("SPEC_URL", "-")]
620 [Property("CRITERIA", "MR")]
621 [Property("AUTHOR", "guowei.wang@samsung.com")]
622 public void CaptureStartIncludeQualityWithNullPath()
624 tlog.Debug(tag, $"CaptureStartIncludeQualityWithNullPath START");
626 var testingTarget = new Capture();
627 Assert.IsNotNull(testingTarget, "Can't create success object Capture");
628 Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
630 using (Container container = new View())
632 using (Size size = new Size(100, 80))
634 using (Color color = Color.Cyan)
638 testingTarget.Start(container, size, null, color, 30);
640 catch (ArgumentNullException e)
642 testingTarget.Dispose();
643 tlog.Debug(tag, e.Message.ToString());
644 tlog.Debug(tag, $"CaptureStartIncludeQualityWithNullPath END (OK)");
645 Assert.Pass("Caught ArgumentNullException: Passed!");
654 [Description("Capture Start include quality. Quality is invalid.")]
655 [Property("SPEC", "Tizen.NUI.Capture.Start M")]
656 [Property("SPEC_URL", "-")]
657 [Property("CRITERIA", "MR")]
658 [Property("AUTHOR", "guowei.wang@samsung.com")]
659 public void CaptureStartIncludeQualityWithInvalidQuality()
661 tlog.Debug(tag, $"CaptureStartIncludeQualityWithInvalidQuality START");
663 var testingTarget = new Capture();
664 Assert.IsNotNull(testingTarget, "Can't create success object Capture");
665 Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
667 using (Container container = new View())
669 using (Size size = new Size(100, 80))
671 using (Color color = Color.Cyan)
675 testingTarget.Start(container, size, jpg_path, color, 130);
677 catch (InvalidOperationException e)
679 testingTarget.Dispose();
680 tlog.Debug(tag, e.Message.ToString());
681 tlog.Debug(tag, $"CaptureStartIncludeQualityWithInvalidQuality END (OK)");
682 Assert.Pass("Caught InvalidOperationException: Passed!");
691 [Description("Capture Start include quality. Size is invalid.")]
692 [Property("SPEC", "Tizen.NUI.Capture.Start M")]
693 [Property("SPEC_URL", "-")]
694 [Property("CRITERIA", "MR")]
695 [Property("AUTHOR", "guowei.wang@samsung.com")]
696 public void CaptureStartIncludeQualityWithInvalidSize()
698 tlog.Debug(tag, $"CaptureStartIncludeQualityWithInvalidSize START");
700 var testingTarget = new Capture();
701 Assert.IsNotNull(testingTarget, "Can't create success object Capture");
702 Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
704 using (Container container = new View())
706 using (Size size = new Size(0, 0))
708 using (Color color = Color.Cyan)
712 testingTarget.Start(container, size, path, color, 30);
714 catch (InvalidOperationException e)
716 testingTarget.Dispose();
717 tlog.Debug(tag, e.Message.ToString());
718 tlog.Debug(tag, $"CaptureStartIncludeQualityWithInvalidSize END (OK)");
719 Assert.Pass("Caught InvalidOperationException: Passed!");
728 //[Description("Capture Start include position.")]
729 //[Property("SPEC", "Tizen.NUI.Capture.Start M")]
730 //[Property("SPEC_URL", "-")]
731 //[Property("CRITERIA", "MR")]
732 //[Property("AUTHOR", "guowei.wang@samsung.com")]
733 //public void CaptureStartIncludePosition()
735 // tlog.Debug(tag, $"CaptureStartIncludePosition START");
737 // var testingTarget = new Capture();
738 // Assert.IsNotNull(testingTarget, "Can't create success object Capture");
739 // Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
741 // using (Container container = new View())
743 // using (Position position = new Position(50, 100))
745 // using (Size size = new Size(100, 80))
747 // using (Color color = Color.Cyan)
751 // testingTarget.Start(container, position, size, path, color);
753 // catch (Exception e)
755 // tlog.Debug(tag, e.Message.ToString());
756 // Assert.Fail("Caught Exception: Failed!");
763 // testingTarget.Dispose();
764 // tlog.Debug(tag, $"CaptureStartIncludePosition END (OK)");
769 [Description("Capture Start include position. Position is null.")]
770 [Property("SPEC", "Tizen.NUI.Capture.Start M")]
771 [Property("SPEC_URL", "-")]
772 [Property("CRITERIA", "MR")]
773 [Property("AUTHOR", "guowei.wang@samsung.com")]
774 public void CaptureStartIncludePositionWithNullPosition()
776 tlog.Debug(tag, $"CaptureStartIncludePositionWithNullPosition START");
778 var testingTarget = new Capture();
779 Assert.IsNotNull(testingTarget, "Can't create success object Capture");
780 Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
782 using (Container container = new View())
784 using (Size size = new Size(100, 80))
786 using (Color color = Color.Cyan)
790 testingTarget.Start(container, null, size, path, color);
792 catch (ArgumentNullException e)
794 testingTarget.Dispose();
795 tlog.Debug(tag, e.Message.ToString());
796 tlog.Debug(tag, $"CaptureStartIncludePositionWithNullPosition END (OK)");
797 Assert.Pass("Caught ArgumentNullException: Passed!");
806 [Description("Capture Start include position. Size is null.")]
807 [Property("SPEC", "Tizen.NUI.Capture.Start M")]
808 [Property("SPEC_URL", "-")]
809 [Property("CRITERIA", "MR")]
810 [Property("AUTHOR", "guowei.wang@samsung.com")]
811 public void CaptureStartIncludePositionWithNullSize()
813 tlog.Debug(tag, $"CaptureStartIncludePositionWithNullSize START");
815 var testingTarget = new Capture();
816 Assert.IsNotNull(testingTarget, "Can't create success object Capture");
817 Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
819 using (Container container = new View())
821 using (Position position = new Position(100, 80))
823 using (Color color = Color.Cyan)
827 testingTarget.Start(container, position, null, path, color);
829 catch (ArgumentNullException e)
831 testingTarget.Dispose();
832 tlog.Debug(tag, e.Message.ToString());
833 tlog.Debug(tag, $"CaptureStartIncludePositionWithNullSize END (OK)");
834 Assert.Pass("Caught ArgumentNullException: Passed!");
843 [Description("Capture Start include position. Color is null.")]
844 [Property("SPEC", "Tizen.NUI.Capture.Start M")]
845 [Property("SPEC_URL", "-")]
846 [Property("CRITERIA", "MR")]
847 [Property("AUTHOR", "guowei.wang@samsung.com")]
848 public void CaptureStartIncludePositionWithNullColor()
850 tlog.Debug(tag, $"CaptureStartIncludePositionWithNullColor START");
852 var testingTarget = new Capture();
853 Assert.IsNotNull(testingTarget, "Can't create success object Capture");
854 Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
856 using (Container container = new View())
858 using (Position position = new Position(50, 100))
860 using (Size size = new Size(100, 80))
864 testingTarget.Start(container, position, size, path, null);
866 catch (ArgumentNullException e)
868 testingTarget.Dispose();
869 tlog.Debug(tag, e.Message.ToString());
870 tlog.Debug(tag, $"CaptureStartIncludePositionWithNullColor END (OK)");
871 Assert.Pass("Caught ArgumentNullException: Passed!");
880 [Description("Capture Start include position. Color is null.")]
881 [Property("SPEC", "Tizen.NUI.Capture.Start M")]
882 [Property("SPEC_URL", "-")]
883 [Property("CRITERIA", "MR")]
884 [Property("AUTHOR", "guowei.wang@samsung.com")]
885 public void CaptureStartIncludePositionWithNullPath()
887 tlog.Debug(tag, $"CaptureStartIncludePositionWithNullPath START");
889 var testingTarget = new Capture();
890 Assert.IsNotNull(testingTarget, "Can't create success object Capture");
891 Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
893 using (Container container = new View())
895 using (Position position = new Position(50, 100))
897 using (Size size = new Size(100, 80))
899 using (Color color = Color.Cyan)
903 testingTarget.Start(container, position, size, null, color);
905 catch (ArgumentNullException e)
907 testingTarget.Dispose();
908 tlog.Debug(tag, e.Message.ToString());
909 tlog.Debug(tag, $"CaptureStartIncludePositionWithNullPath END (OK)");
910 Assert.Pass("Caught ArgumentNullException: Passed!");
920 [Description("Capture Start include position. Size is invalid.")]
921 [Property("SPEC", "Tizen.NUI.Capture.Start M")]
922 [Property("SPEC_URL", "-")]
923 [Property("CRITERIA", "MR")]
924 [Property("AUTHOR", "guowei.wang@samsung.com")]
925 public void CaptureStartIncludePositionWithInvalidSize()
927 tlog.Debug(tag, $"CaptureStartIncludePositionWithInvalidSize START");
929 var testingTarget = new Capture();
930 Assert.IsNotNull(testingTarget, "Can't create success object Capture");
931 Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
933 using (Container container = new View())
935 using (Position position = new Position(50, 100))
937 using (Size size = new Size(0, 0))
939 using (Color color = Color.Cyan)
943 testingTarget.Start(container, position, size, path, color);
945 catch (InvalidOperationException e)
947 testingTarget.Dispose();
948 tlog.Debug(tag, e.Message.ToString());
949 tlog.Debug(tag, $"CaptureStartIncludePositionWithInvalidSize END (OK)");
950 Assert.Pass("Caught InvalidOperationException: Passed!");
960 [Description("Capture Finished.")]
961 [Property("SPEC", "Tizen.NUI.Capture.Finished M")]
962 [Property("SPEC_URL", "-")]
963 [Property("CRITERIA", "MR")]
964 [Property("AUTHOR", "guowei.wang@samsung.com")]
965 public void CaptureFinished()
967 tlog.Debug(tag, $"CaptureFinished START");
969 var testingTarget = new MyCapture();
970 Assert.IsNotNull(testingTarget, "Can't create success object MyCapture");
971 Assert.IsInstanceOf<MyCapture>(testingTarget, "Should be an instance of MyCapture type.");
973 testingTarget.Finished += OnFinishedEvent;
974 testingTarget.Finished -= OnFinishedEvent;
976 testingTarget.Dispose();
977 tlog.Debug(tag, $"CaptureFinished END (OK)");
982 [Description("Capture GetNativeImageSource.")]
983 [Property("SPEC", "Tizen.NUI.Capture.GetNativeImageSource M")]
984 [Property("SPEC_URL", "-")]
985 [Property("CRITERIA", "MR")]
986 [Property("AUTHOR", "guowei.wang@samsung.com")]
987 public void CaptureGetNativeImageSource()
989 tlog.Debug(tag, $"CaptureGetNativeImageSource START");
991 var testingTarget = new MyCapture();
992 Assert.IsNotNull(testingTarget, "Can't create success object MyCapture");
993 Assert.IsInstanceOf<MyCapture>(testingTarget, "Should be an instance of MyCapture type.");
995 var result = testingTarget.GetNativeImageSource();
996 Assert.IsNotNull(result, "Can't create success object NativeImageSource ");
997 Assert.IsInstanceOf<NativeImageSource>(result, "Should be an instance of NativeImageSource type.");
999 testingTarget.Dispose();
1000 tlog.Debug(tag, $"CaptureGetNativeImageSource END (OK)");
1005 [Description("Capture.CaptureFinishedEventArgs Success.")]
1006 [Property("SPEC", "Tizen.NUI.Capture.CaptureFinishedEventArgs.Success A")]
1007 [Property("SPEC_URL", "-")]
1008 [Property("CRITERIA", "PRW")]
1009 [Property("AUTHOR", "guowei.wang@samsung.com")]
1010 public void CaptureCaptureFinishedEventArgsSuccess()
1012 tlog.Debug(tag, $"CaptureCaptureFinishedEventArgsSuccess START");
1014 var testingTarget = new CaptureFinishedEventArgs();
1015 Assert.IsNotNull(testingTarget, "Can't create success object CaptureFinishedEventArgs");
1016 Assert.IsInstanceOf<CaptureFinishedEventArgs>(testingTarget, "Should be an instance of CaptureFinishedEventArgs type.");
1018 Assert.AreEqual(false, testingTarget.Success, "Should be equal!");
1020 testingTarget.Success = true;
1021 Assert.AreEqual(true, testingTarget.Success, "Should be equal!");
1023 tlog.Debug(tag, $"CaptureCaptureFinishedEventArgsSuccess END (OK)");
1028 [Description("Capture.CaptureSignal constructor.")]
1029 [Property("SPEC", "Tizen.NUI.Capture.CaptureSignal.CaptureSignal M")]
1030 [Property("SPEC_URL", "-")]
1031 [Property("CRITERIA", "MR")]
1032 [Property("AUTHOR", "guowei.wang@samsung.com")]
1033 public void CaptureCaptureSignalConstructor()
1035 tlog.Debug(tag, $"CaptureCaptureSignalConstructor START");
1037 using (Capture capture = new Capture())
1039 var testingTarget = new CaptureSignal(capture.SwigCPtr.Handle, true);
1040 Assert.IsNotNull(testingTarget, "Can't create success object CaptureSignal");
1041 Assert.IsInstanceOf<CaptureSignal>(testingTarget, "Should be an instance of CaptureSignal type.");
1043 testingTarget.Dispose();
1046 tlog.Debug(tag, $"CaptureCaptureSignalConstructor END (OK)");
1051 [Description("Capture.CaptureSignal Empty.")]
1052 [Property("SPEC", "Tizen.NUI.Capture.CaptureSignal.Empty M")]
1053 [Property("SPEC_URL", "-")]
1054 [Property("CRITERIA", "MR")]
1055 [Property("AUTHOR", "guowei.wang@samsung.com")]
1056 public void CaptureCaptureSignalEmpty()
1058 tlog.Debug(tag, $"CaptureCaptureSignalEmpty START");
1060 using (Capture capture = new Capture())
1062 var testingTarget = new CaptureSignal(capture.SwigCPtr.Handle, true);
1063 Assert.IsNotNull(testingTarget, "Can't create success object CaptureSignal");
1064 Assert.IsInstanceOf<CaptureSignal>(testingTarget, "Should be an instance of CaptureSignal type.");
1068 var result = testingTarget.Empty();
1069 tlog.Debug(tag, "Empty : " + result);
1073 tlog.Debug(tag, e.Message.ToString());
1074 Assert.Fail("Caught Exception : Failed!");
1077 testingTarget.Dispose();
1080 tlog.Debug(tag, $"CaptureCaptureSignalEmpty END (OK)");
1085 [Description("Capture.CaptureSignal GetConnectionCount.")]
1086 [Property("SPEC", "Tizen.NUI.Capture.CaptureSignal.GetConnectionCount M")]
1087 [Property("SPEC_URL", "-")]
1088 [Property("CRITERIA", "MR")]
1089 [Property("AUTHOR", "guowei.wang@samsung.com")]
1090 public void CaptureCaptureSignalGetConnectionCount()
1092 tlog.Debug(tag, $"CaptureCaptureSignalGetConnectionCount START");
1094 using (Capture capture = new Capture())
1096 var testingTarget = new CaptureSignal(capture.SwigCPtr.Handle, true);
1097 Assert.IsNotNull(testingTarget, "Can't create success object CaptureSignal");
1098 Assert.IsInstanceOf<CaptureSignal>(testingTarget, "Should be an instance of CaptureSignal type.");
1100 var result = testingTarget.GetConnectionCount();
1101 Assert.AreEqual(0, result, "Should be equal!");
1103 testingTarget.Dispose();
1106 tlog.Debug(tag, $"CaptureCaptureSignalGetConnectionCount END (OK)");
1111 [Description("Capture.CaptureSignal Emit.")]
1112 [Property("SPEC", "Tizen.NUI.Capture.CaptureSignal.Emit M")]
1113 [Property("SPEC_URL", "-")]
1114 [Property("CRITERIA", "MR")]
1115 [Property("AUTHOR", "guowei.wang@samsung.com")]
1116 public void CaptureCaptureSignalEmit()
1118 tlog.Debug(tag, $"CaptureCaptureSignalEmit START");
1120 var currentPid = global::System.Diagnostics.Process.GetCurrentProcess().Id;
1121 var currentTid = global::System.Threading.Thread.CurrentThread.ManagedThreadId;
1123 tlog.Debug(tag, $"thread check! main pid={App.mainPid}, current pid={currentPid}, main tid={App.mainTid}, current tid={currentTid}");
1125 using (Capture capture = new Capture())
1127 var testingTarget = new CaptureSignal(capture.SwigCPtr.Handle, true);
1128 Assert.IsNotNull(testingTarget, "Can't create success object CaptureSignal");
1129 Assert.IsInstanceOf<CaptureSignal>(testingTarget, "Should be an instance of CaptureSignal type.");
1131 testingTarget.Emit(capture, true);
1133 testingTarget.Dispose();
1136 tlog.Debug(tag, $"CaptureCaptureSignalEmit END (OK)");
1139 private void OnFinishedEvent(object sender, CaptureFinishedEventArgs e)
1141 // Do not implementation