Repository: flex-sdk
Updated Branches:
  refs/heads/develop e87c827b2 -> 22f81c478


FLEX-35031
Added two more test functions to assert that dynamic object instances should 
work the same as anonymous object instances for finding items via 
HierarchicalCollectionViewCursor. Currently they pass, as expected.


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/e68c148a
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/e68c148a
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/e68c148a

Branch: refs/heads/develop
Commit: e68c148afcb5042ee61339c4b7eb55c80bf8fe46
Parents: e87c827
Author: Mihai Chira <[email protected]>
Authored: Wed Feb 17 10:28:53 2016 +0100
Committer: Mihai Chira <[email protected]>
Committed: Wed Feb 17 10:28:53 2016 +0100

----------------------------------------------------------------------
 ...rchicalCollectionViewCursor_FindAny_Tests.as | 38 ++++++++++++++++++++
 1 file changed, 38 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/e68c148a/frameworks/projects/advancedgrids/tests/mx/collections/HierarchicalCollectionViewCursor_FindAny_Tests.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/advancedgrids/tests/mx/collections/HierarchicalCollectionViewCursor_FindAny_Tests.as
 
b/frameworks/projects/advancedgrids/tests/mx/collections/HierarchicalCollectionViewCursor_FindAny_Tests.as
index 5a64c03..33c1269 100644
--- 
a/frameworks/projects/advancedgrids/tests/mx/collections/HierarchicalCollectionViewCursor_FindAny_Tests.as
+++ 
b/frameworks/projects/advancedgrids/tests/mx/collections/HierarchicalCollectionViewCursor_FindAny_Tests.as
@@ -277,6 +277,36 @@ package mx.collections {
             assertEquals(ID_TO_FIND, currentEmployee.uniqueID);
         }
 
+        [Test]
+        public function 
test_findAny_finds_sealed_class_instance_via_dynamic_class_instance_with_subset_of_properties():void
+        {
+            //given
+            _utils.openAllNodes(_collectionView);
+            var lastEmployee:EmployeeVO = _employeesByID[_employeesByID.length 
- 1];
+
+            //when
+            var found:Boolean = _sut.findLast(new 
DynamicVO(lastEmployee.name));
+
+            //then
+            assertTrue(found);
+            assertEquals(lastEmployee, _sut.current);
+        }
+
+        [Test]
+        public function 
test_findLast_finds_sealed_class_instance_via_dynamic_class_instance_with_subset_of_properties():void
+        {
+            //given
+            _utils.openAllNodes(_collectionView);
+            var firstEmployee:EmployeeVO = _employeesByID[0];
+
+            //when
+            var found:Boolean = _sut.findLast(new 
DynamicVO(firstEmployee.name));
+
+            //then
+            assertTrue(found);
+            assertEquals(firstEmployee, _sut.current);
+        }
+
         /**
          * Note that in a perfect world this would work. However, to 
accomplish this task
          * we'd need to use <code>flash.utils.describeType()</code> (or
@@ -405,4 +435,12 @@ class NamedVO
     {
         this.name = name;
     }
+}
+
+dynamic class DynamicVO
+{
+    public function DynamicVO(name:String)
+    {
+        this.name = name;
+    }
 }
\ No newline at end of file

Reply via email to