1 using NUnit.Framework;
3 using System.Collections;
4 using System.Collections.Generic;
5 using System.Collections.ObjectModel;
6 using System.Collections.Specialized;
8 using System.Threading.Tasks;
9 using Tizen.NUI.BaseComponents;
10 using Tizen.NUI.Binding;
12 namespace Tizen.NUI.Components.Devel.Tests
14 using tlog = Tizen.Log;
17 [Description("Controls/RecyclerView/ItemSource/CollectionView")]
18 class TSCollectionView
20 private const string tag = "NUITEST";
22 private class TestModel : ObservableCollection<string>
24 private string[] namePool = {
37 "Tower with the Moon",
52 private ObservableCollection<string> CreateData(ObservableCollection<string> result, int count)
54 for (int i = 0; i < count; i++)
56 result.Add(namePool[i % 20]);
62 private DataTemplate testDataTemplate;
67 tlog.Info(tag, "Init() is called!");
69 testDataTemplate = new DataTemplate(() =>
71 var rand = new Random();
72 DefaultLinearItem item = new DefaultLinearItem();
73 //Set Width Specification as MatchParent to fit the Item width with parent View.
74 item.WidthSpecification = LayoutParamPolicies.MatchParent;
77 item.Label.SetBinding(TextLabel.TextProperty, "ViewLabel");
78 item.Label.HorizontalAlignment = HorizontalAlignment.Begin;
81 if ((rand.Next() % 2) == 0)
83 item.SubLabel.SetBinding(TextLabel.TextProperty, "Name");
84 item.SubLabel.HorizontalAlignment = HorizontalAlignment.Begin;
94 tlog.Info(tag, "Destroy() is called!");
99 [Description("CollectionView constructor.")]
100 [Property("SPEC", "Tizen.NUI.Components.CollectionView C")]
101 [Property("SPEC_URL", "-")]
102 [Property("CRITERIA", "CONSTR")]
103 [Property("COVPARAM", "")]
104 [Property("AUTHOR", "huayong.xu@samsung.com")]
105 public void CollectionViewConstructor()
107 tlog.Debug(tag, $"CollectionViewConstructor START");
109 var testingTarget = new CollectionView();
111 Assert.IsNotNull(testingTarget, "should be not null");
112 Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
114 testingTarget.Dispose();
115 tlog.Debug(tag, $"CollectionViewConstructor END (OK)");
120 [Description("CollectionView constructor.")]
121 [Property("SPEC", "Tizen.NUI.Components.CollectionView C")]
122 [Property("SPEC_URL", "-")]
123 [Property("CRITERIA", "CONSTR")]
124 [Property("COVPARAM", "")]
125 [Property("AUTHOR", "huayong.xu@samsung.com")]
126 public void CollectionViewConstructorWithItemsSource()
128 tlog.Debug(tag, $"CollectionViewConstructorWithItemsSource START");
130 var model = new TestModel();
131 var testingTarget = new CollectionView(model);
133 Assert.IsNotNull(testingTarget, "should be not null");
134 Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
136 testingTarget.Dispose();
137 tlog.Debug(tag, $"CollectionViewConstructorWithItemsSource END (OK)");
142 [Description("CollectionView constructor.")]
143 [Property("SPEC", "Tizen.NUI.Components.CollectionView C")]
144 [Property("SPEC_URL", "-")]
145 [Property("CRITERIA", "CONSTR")]
146 [Property("COVPARAM", "")]
147 [Property("AUTHOR", "huayong.xu@samsung.com")]
148 public void CollectionViewConstructorWithItemsSourceLayouterTemplate()
150 tlog.Debug(tag, $"CollectionViewConstructorWithItemsSourceLayouterTemplate START");
152 var model = new TestModel();
153 var testingTarget = new CollectionView(model, new LinearLayouter(), testDataTemplate);
155 Assert.IsNotNull(testingTarget, "should be not null");
156 Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
158 testingTarget.Dispose();
159 tlog.Debug(tag, $"CollectionViewConstructorWithItemsSourceLayouterTemplate END (OK)");
164 [Description("CollectionView ItemsSource.")]
165 [Property("SPEC", "Tizen.NUI.Components.CollectionView.ItemsSource A")]
166 [Property("SPEC_URL", "-")]
167 [Property("CRITERIA", "PRW")]
168 [Property("COVPARAM", "")]
169 [Property("AUTHOR", "huayong.xu@samsung.com")]
170 public void CollectionViewItemsSource()
172 tlog.Debug(tag, $"CollectionViewItemsSource START");
174 var testingTarget = new CollectionView();
176 Assert.IsNotNull(testingTarget, "should be not null");
177 Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
179 testingTarget.ItemsSource = new TestModel();
180 Assert.IsNotNull(testingTarget.ItemsSource, "should be not null");
182 testingTarget.Dispose();
183 tlog.Debug(tag, $"CollectionViewItemsSource END (OK)");
188 [Description("CollectionView ItemTemplate.")]
189 [Property("SPEC", "Tizen.NUI.Components.CollectionView.ItemTemplate A")]
190 [Property("SPEC_URL", "-")]
191 [Property("CRITERIA", "PRW")]
192 [Property("COVPARAM", "")]
193 [Property("AUTHOR", "huayong.xu@samsung.com")]
194 public void CollectionViewItemTemplate()
196 tlog.Debug(tag, $"CollectionViewItemTemplate START");
198 var testingTarget = new CollectionView();
200 Assert.IsNotNull(testingTarget, "should be not null");
201 Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
203 testingTarget.ItemTemplate = testDataTemplate;
204 Assert.IsNotNull(testingTarget.ItemTemplate, "should be not null");
206 testingTarget.Dispose();
207 tlog.Debug(tag, $"CollectionViewItemTemplate END (OK)");
212 [Description("CollectionView ItemTemplate.")]
213 [Property("SPEC", "Tizen.NUI.Components.CollectionView.ItemTemplate A")]
214 [Property("SPEC_URL", "-")]
215 [Property("CRITERIA", "PRW")]
216 [Property("COVPARAM", "")]
217 [Property("AUTHOR", "huayong.xu@samsung.com")]
218 public void CollectionViewItemTemplateNull()
220 tlog.Debug(tag, $"CollectionViewItemTemplateNull START");
222 var testingTarget = new CollectionView();
224 Assert.IsNotNull(testingTarget, "should be not null");
225 Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
227 testingTarget.ItemTemplate = null;
228 Assert.IsNull(testingTarget.ItemTemplate, "should be null");
230 testingTarget.Dispose();
231 tlog.Debug(tag, $"CollectionViewItemTemplateNull END (OK)");
236 [Description("CollectionView ItemsLayouter.")]
237 [Property("SPEC", "Tizen.NUI.Components.CollectionView.ItemsLayouter A")]
238 [Property("SPEC_URL", "-")]
239 [Property("CRITERIA", "PRW")]
240 [Property("COVPARAM", "")]
241 [Property("AUTHOR", "huayong.xu@samsung.com")]
242 public void CollectionViewItemsLayouter()
244 tlog.Debug(tag, $"CollectionViewItemsLayouter START");
246 var testingTarget = new CollectionView();
248 Assert.IsNotNull(testingTarget, "should be not null");
249 Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
251 testingTarget.ItemsLayouter = new LinearLayouter();
252 Assert.IsNotNull(testingTarget.ItemsLayouter, "should not be null");
254 testingTarget.Dispose();
255 tlog.Debug(tag, $"CollectionViewItemsLayouter END (OK)");
260 [Description("CollectionView ItemsLayouter.")]
261 [Property("SPEC", "Tizen.NUI.Components.CollectionView.ItemsLayouter A")]
262 [Property("SPEC_URL", "-")]
263 [Property("CRITERIA", "PRW")]
264 [Property("COVPARAM", "")]
265 [Property("AUTHOR", "huayong.xu@samsung.com")]
266 public void CollectionViewItemsLayouterNull()
268 tlog.Debug(tag, $"CollectionViewItemsLayouterNull START");
270 var testingTarget = new CollectionView();
272 Assert.IsNotNull(testingTarget, "should be not null");
273 Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
275 testingTarget.ItemsLayouter = null;
276 Assert.IsNull(testingTarget.ItemsLayouter, "should be null");
278 testingTarget.Dispose();
279 tlog.Debug(tag, $"CollectionViewItemsLayouterNull END (OK)");
284 [Description("CollectionView ScrollingDirection.")]
285 [Property("SPEC", "Tizen.NUI.Components.CollectionView.ScrollingDirection A")]
286 [Property("SPEC_URL", "-")]
287 [Property("CRITERIA", "PRW")]
288 [Property("COVPARAM", "")]
289 [Property("AUTHOR", "huayong.xu@samsung.com")]
290 public void CollectionViewScrollingDirection()
292 tlog.Debug(tag, $"CollectionViewScrollingDirection START");
294 var testingTarget = new CollectionView();
296 Assert.IsNotNull(testingTarget, "should be not null");
297 Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
299 testingTarget.ScrollingDirection = ScrollableBase.Direction.Horizontal;
300 Assert.AreEqual(testingTarget.ScrollingDirection, ScrollableBase.Direction.Horizontal, "should be horizontal");
302 testingTarget.Dispose();
303 tlog.Debug(tag, $"CollectionViewScrollingDirection END (OK)");
308 [Description("CollectionView SelectedItem.")]
309 [Property("SPEC", "Tizen.NUI.Components.CollectionView.SelectedItem A")]
310 [Property("SPEC_URL", "-")]
311 [Property("CRITERIA", "PRW")]
312 [Property("COVPARAM", "")]
313 [Property("AUTHOR", "huayong.xu@samsung.com")]
314 public void CollectionViewSelectedItem()
316 tlog.Debug(tag, $"CollectionViewSelectedItem START");
318 var model = new TestModel();
319 var testingTarget = new CollectionView(model);
321 Assert.IsNotNull(testingTarget, "should be not null");
322 Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
324 testingTarget.SelectedItem = "Cat";
325 Assert.AreEqual(testingTarget.SelectedItem, "Cat", "Some items should be selected");
327 testingTarget.Dispose();
328 tlog.Debug(tag, $"CollectionViewSelectedItem END (OK)");
333 [Description("CollectionView SelectedItems.")]
334 [Property("SPEC", "Tizen.NUI.Components.CollectionView.SelectedItems A")]
335 [Property("SPEC_URL", "-")]
336 [Property("CRITERIA", "PRW")]
337 [Property("COVPARAM", "")]
338 [Property("AUTHOR", "huayong.xu@samsung.com")]
339 public void CollectionViewSelectedItems()
341 tlog.Debug(tag, $"CollectionViewSelectedItems START");
343 var model = new TestModel();
344 var testingTarget = new CollectionView(model);
346 Assert.IsNotNull(testingTarget, "should be not null");
347 Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
349 tlog.Debug(tag, "SelectedItems : " + testingTarget.SelectedItems);
351 testingTarget.Dispose();
352 tlog.Debug(tag, $"CollectionViewSelectedItems END (OK)");
357 [Description("CollectionView SelectionMode.")]
358 [Property("SPEC", "Tizen.NUI.Components.CollectionView.SelectionMode A")]
359 [Property("SPEC_URL", "-")]
360 [Property("CRITERIA", "PRW")]
361 [Property("COVPARAM", "")]
362 [Property("AUTHOR", "huayong.xu@samsung.com")]
363 public void CollectionViewSelectionMode()
365 tlog.Debug(tag, $"CollectionViewSelectionMode START");
367 var model = new TestModel();
368 var testingTarget = new CollectionView(model);
370 Assert.IsNotNull(testingTarget, "should be not null");
371 Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
373 testingTarget.SelectionMode = ItemSelectionMode.None;
374 Assert.AreEqual(testingTarget.SelectionMode, ItemSelectionMode.None, "Selection mode is none.");
376 testingTarget.Dispose();
377 tlog.Debug(tag, $"CollectionViewSelectionMode END (OK)");
382 [Description("CollectionView SelectionChangedCommand.")]
383 [Property("SPEC", "Tizen.NUI.Components.CollectionView.SelectionChangedCommand A")]
384 [Property("SPEC_URL", "-")]
385 [Property("CRITERIA", "PRW")]
386 [Property("COVPARAM", "")]
387 [Property("AUTHOR", "huayong.xu@samsung.com")]
388 public void CollectionViewSelectionChangedCommand()
390 tlog.Debug(tag, $"CollectionViewSelectionChangedCommand START");
392 var model = new TestModel();
393 var testingTarget = new CollectionView(model);
395 Assert.IsNotNull(testingTarget, "should be not null");
396 Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
398 testingTarget.SelectionChangedCommand = null;
399 Assert.IsNull(testingTarget.SelectionChangedCommand, "Selection change command is null.");
401 testingTarget.Dispose();
402 tlog.Debug(tag, $"CollectionViewSelectionChangedCommand END (OK)");
407 [Description("CollectionView SelectionChangedCommandParameter.")]
408 [Property("SPEC", "Tizen.NUI.Components.CollectionView.SelectionChangedCommandParameter A")]
409 [Property("SPEC_URL", "-")]
410 [Property("CRITERIA", "PRW")]
411 [Property("COVPARAM", "")]
412 [Property("AUTHOR", "huayong.xu@samsung.com")]
413 public void CollectionViewSelectionChangedCommandParameter()
415 tlog.Debug(tag, $"CollectionViewSelectionChangedCommandParameter START");
417 var model = new TestModel();
418 var testingTarget = new CollectionView(model);
420 Assert.IsNotNull(testingTarget, "should be not null");
421 Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
423 testingTarget.SelectionChangedCommandParameter = null;
424 Assert.IsNull(testingTarget.SelectionChangedCommandParameter, "Selection change command parameter is null.");
426 testingTarget.Dispose();
427 tlog.Debug(tag, $"CollectionViewSelectionChangedCommandParameter END (OK)");
432 [Description("CollectionView Header.")]
433 [Property("SPEC", "Tizen.NUI.Components.CollectionView.Header A")]
434 [Property("SPEC_URL", "-")]
435 [Property("CRITERIA", "PRW")]
436 [Property("COVPARAM", "")]
437 [Property("AUTHOR", "huayong.xu@samsung.com")]
438 public void CollectionViewHeader()
440 tlog.Debug(tag, $"CollectionViewHeader START");
442 var model = new TestModel();
443 var testingTarget = new CollectionView(model);
445 Assert.IsNotNull(testingTarget, "should be not null");
446 Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
448 DefaultTitleItem myTitle = new DefaultTitleItem();
449 myTitle.Text = "test";
450 testingTarget.Header = myTitle;
451 Assert.IsNotNull(testingTarget.Header, "should be header.");
453 testingTarget.Dispose();
454 tlog.Debug(tag, $"CollectionViewHeader END (OK)");
459 [Description("CollectionView Footer.")]
460 [Property("SPEC", "Tizen.NUI.Components.CollectionView.Footer A")]
461 [Property("SPEC_URL", "-")]
462 [Property("CRITERIA", "PRW")]
463 [Property("COVPARAM", "")]
464 [Property("AUTHOR", "huayong.xu@samsung.com")]
465 public void CollectionViewFooter()
467 tlog.Debug(tag, $"CollectionViewFooter START");
469 var model = new TestModel();
470 var testingTarget = new CollectionView(model);
472 Assert.IsNotNull(testingTarget, "should be not null");
473 Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
475 DefaultTitleItem myTitle = new DefaultTitleItem();
476 myTitle.Text = "test";
477 testingTarget.Footer = myTitle;
478 Assert.IsNotNull(testingTarget.Footer, "should be footer.");
480 testingTarget.Dispose();
481 tlog.Debug(tag, $"CollectionViewFooter END (OK)");
486 [Description("CollectionView IsGrouped.")]
487 [Property("SPEC", "Tizen.NUI.Components.CollectionView.IsGrouped A")]
488 [Property("SPEC_URL", "-")]
489 [Property("CRITERIA", "PRW")]
490 [Property("COVPARAM", "")]
491 [Property("AUTHOR", "huayong.xu@samsung.com")]
492 public void CollectionViewIsGrouped()
494 tlog.Debug(tag, $"CollectionViewIsGrouped START");
496 var model = new TestModel();
497 var testingTarget = new CollectionView(model);
499 Assert.IsNotNull(testingTarget, "should be not null");
500 Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
502 testingTarget.IsGrouped = true;
503 Assert.IsTrue(testingTarget.IsGrouped, "should be grouped.");
505 testingTarget.Dispose();
506 tlog.Debug(tag, $"CollectionViewIsGrouped END (OK)");
511 [Description("CollectionView GroupHeaderTemplate.")]
512 [Property("SPEC", "Tizen.NUI.Components.CollectionView.GroupHeaderTemplate A")]
513 [Property("SPEC_URL", "-")]
514 [Property("CRITERIA", "PRW")]
515 [Property("COVPARAM", "")]
516 [Property("AUTHOR", "huayong.xu@samsung.com")]
517 public void CollectionViewGroupHeaderTemplate()
519 tlog.Debug(tag, $"CollectionViewGroupHeaderTemplate START");
521 var model = new TestModel();
522 var testingTarget = new CollectionView(model);
524 Assert.IsNotNull(testingTarget, "should be not null");
525 Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
527 testingTarget.GroupHeaderTemplate = testDataTemplate;
528 Assert.IsNotNull(testingTarget.GroupHeaderTemplate, "should not be null.");
530 testingTarget.Dispose();
531 tlog.Debug(tag, $"CollectionViewGroupHeaderTemplate END (OK)");
536 [Description("CollectionView GroupFooterTemplate.")]
537 [Property("SPEC", "Tizen.NUI.Components.CollectionView.GroupFooterTemplate A")]
538 [Property("SPEC_URL", "-")]
539 [Property("CRITERIA", "PRW")]
540 [Property("COVPARAM", "")]
541 [Property("AUTHOR", "huayong.xu@samsung.com")]
542 public void CollectionViewGroupFooterTemplate()
544 tlog.Debug(tag, $"CollectionViewGroupFooterTemplate START");
546 var model = new TestModel();
547 var testingTarget = new CollectionView(model);
549 Assert.IsNotNull(testingTarget, "should be not null");
550 Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
552 testingTarget.GroupFooterTemplate = testDataTemplate;
553 Assert.IsNotNull(testingTarget.GroupFooterTemplate, "should not be null.");
555 testingTarget.Dispose();
556 tlog.Debug(tag, $"CollectionViewGroupFooterTemplate END (OK)");
561 [Description("CollectionView InternalItemSource.")]
562 [Property("SPEC", "Tizen.NUI.Components.CollectionView.InternalItemSource A")]
563 [Property("SPEC_URL", "-")]
564 [Property("CRITERIA", "PRW")]
565 [Property("COVPARAM", "")]
566 [Property("AUTHOR", "huayong.xu@samsung.com")]
567 public void CollectionViewInternalItemSource()
569 tlog.Debug(tag, $"CollectionViewInternalItemSource START");
571 var model = new TestModel();
572 var testingTarget = new CollectionView(model);
574 Assert.IsNotNull(testingTarget, "should be not null");
575 Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
577 testingTarget.InternalItemSource = null;
578 Assert.IsNull(testingTarget.InternalItemSource, "should be null.");
580 testingTarget.Dispose();
581 tlog.Debug(tag, $"CollectionViewInternalItemSource END (OK)");
586 [Description("CollectionView SizingStrategy.")]
587 [Property("SPEC", "Tizen.NUI.Components.CollectionView.SizingStrategy A")]
588 [Property("SPEC_URL", "-")]
589 [Property("CRITERIA", "PRW")]
590 [Property("COVPARAM", "")]
591 [Property("AUTHOR", "huayong.xu@samsung.com")]
592 public void CollectionViewSizingStrategy()
594 tlog.Debug(tag, $"CollectionViewSizingStrategy START");
596 var model = new TestModel();
597 var testingTarget = new CollectionView(model);
599 Assert.IsNotNull(testingTarget, "should be not null");
600 Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
602 testingTarget.SizingStrategy = ItemSizingStrategy.MeasureFirst;
603 Assert.AreEqual(testingTarget.SizingStrategy, ItemSizingStrategy.MeasureFirst, "should be equal.");
605 testingTarget.Dispose();
606 tlog.Debug(tag, $"CollectionViewSizingStrategy END (OK)");
611 [Description("CollectionView UpdateSelectedItems.")]
612 [Property("SPEC", "Tizen.NUI.Components.CollectionView.UpdateSelectedItems M")]
613 [Property("SPEC_URL", "-")]
614 [Property("CRITERIA", "MR")]
615 [Property("COVPARAM", "")]
616 [Property("AUTHOR", "huayong.xu@samsung.com")]
617 public void CollectionViewUpdateSelectedItems()
619 tlog.Debug(tag, $"CollectionViewUpdateSelectedItems START");
621 var model = new TestModel();
622 var testingTarget = new CollectionView(model);
624 Assert.IsNotNull(testingTarget, "should be not null");
625 Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
629 testingTarget.UpdateSelectedItems(null);
631 catch (ArgumentNullException)
633 testingTarget.Dispose();
634 tlog.Debug(tag, $"CollectionViewUpdateSelectedItems END (OK)");
635 Assert.Pass("Caught ArgumentNullException : Passed!");
641 [Description("CollectionView ScrollTo.")]
642 [Property("SPEC", "Tizen.NUI.Components.CollectionView.ScrollTo M")]
643 [Property("SPEC_URL", "-")]
644 [Property("CRITERIA", "MR")]
645 [Property("COVPARAM", "")]
646 [Property("AUTHOR", "huayong.xu@samsung.com")]
647 public void CollectionViewUpdateScrollTo()
649 tlog.Debug(tag, $"CollectionViewUpdateScrollTo START");
651 var model = new TestModel();
652 var testingTarget = new CollectionView(model, new LinearLayouter(), testDataTemplate);
653 Assert.IsNotNull(testingTarget, "should be not null");
654 Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
656 testingTarget.ScrollTo(123.0f, false);
657 tlog.Debug(tag, "SelectedItems : " + testingTarget.SelectedItems);
659 testingTarget.Dispose();
660 tlog.Debug(tag, $"CollectionViewUpdateScrollTo END (OK)");
665 [Description("CollectionView ScrollToIndex.")]
666 [Property("SPEC", "Tizen.NUI.Components.CollectionView.ScrollToIndex M")]
667 [Property("SPEC_URL", "-")]
668 [Property("CRITERIA", "MR")]
669 [Property("COVPARAM", "")]
670 [Property("AUTHOR", "huayong.xu@samsung.com")]
671 public void CollectionViewScrollToIndex()
673 tlog.Debug(tag, $"CollectionViewScrollToIndex START");
675 var model = new TestModel();
676 var testingTarget = new CollectionView(model, new LinearLayouter(), testDataTemplate);
678 Assert.IsNotNull(testingTarget, "should be not null");
679 Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
681 testingTarget.ScrollToIndex(5);
682 tlog.Debug(tag, "SelectedItems : " + testingTarget.SelectedItems);
684 testingTarget.Dispose();
685 tlog.Debug(tag, $"CollectionViewScrollToIndex END (OK)");
690 [Description("CollectionView GetNextFocusableView.")]
691 [Property("SPEC", "Tizen.NUI.Components.CollectionView.GetNextFocusableView M")]
692 [Property("SPEC_URL", "-")]
693 [Property("CRITERIA", "MR")]
694 [Property("COVPARAM", "")]
695 [Property("AUTHOR", "huayong.xu@samsung.com")]
696 public async Task CollectionViewGetNextFocusableView()
698 tlog.Debug(tag, $"CollectionViewGetNextFocusableView START");
700 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
701 EventHandler onAddedToWindow = (s, e) => { tcs.TrySetResult(true); };
703 var model = new TestModel();
704 var testingTarget = new CollectionView(model, new LinearLayouter(), testDataTemplate);
705 testingTarget.AddedToWindow += onAddedToWindow;
706 testingTarget.Size = new Size(100, 100);
708 Assert.IsNotNull(testingTarget, "should be not null");
709 Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
711 Window.Instance.Add(testingTarget);
712 var result = await tcs.Task;
713 Assert.IsTrue(result, "Relayout event should be invoked");
715 testingTarget.GetNextFocusableView(null, View.FocusDirection.Down, false);
716 tlog.Debug(tag, "SelectedItems : " + testingTarget.SelectedItems);
718 if (testingTarget != null)
720 Window.Instance.Remove(testingTarget);
721 testingTarget.Dispose();
722 testingTarget = null;
724 tlog.Debug(tag, $"CollectionViewGetNextFocusableView END (OK)");