     import mx.collections.IList;
     import mx.collections.ListCollectionView;
     import mx.collections.Sort;
+    import mx.collections.SortFieldCompareTypes;
 
     import org.flexunit.asserts.assertEquals;
 

    [Bindable]
    public var street:String;

    public function FLEX_34852_AddressVO(street:String)
    {
        this.street = street;
    }
}
        }

        [Test]
        public function test_simple_ascending_sort_by_complex_string_fields():void
        {
            //given
            var from4To0:IList = generateVOs(5, true);
            _sut.addAll(from4To0); //values["address.street"]: Street4, Street3, Street2, Street1, Street0

            const sortByStreetAscending:Sort = new Sort();
            sortByStreetAscending.fields = [new ComplexSortField("address.street", false, false, false)];
            _sut.sort = sortByStreetAscending;

            //when
            _sut.refresh(); //should be: Street0, Street1, Street2, Street3, Street4

            //then
            assertIndexesAre([0, 1, 2, 3, 4]);
        }

        [Test]
        public function test_simple_descending_sort_by_complex_string_fields():void
        {
            //given
            var from0To4:IList = generateVOs(5);
            _sut.addAll(from0To4); //values["address.street"]: Street0, Street1, Street2, Street3, Street4

            const sortByStreetDescending:Sort = new Sort();
            sortByStreetDescending.fields = [new ComplexSortField("address.street", false, true, false)];
            _sut.sort = sortByStreetDescending;

            //when
            _sut.refresh(); //should be: Street4, Street3, Street2, Street1, Street0

            //then
            assertIndexesAre([4, 3, 2, 1, 0]);
        }

        [Test]
        public function test_simple_ascending_sort_by_complex_date_fields():void
        {
            //given
            var from2004To2000:IList = generateVOs(5, true);
            _sut.addAll(from2004To2000); //values["address.dateMovedIn"].getYear(): 2004, 2003, 2002, 2001, 2000

            const sortByDateMovedInAscending:Sort = new Sort();
            var complexSortField:ComplexSortField = new ComplexSortField("address.dateMovedIn", false, false, false);
            complexSortField.sortCompareType = SortFieldCompareTypes.DATE;
            sortByDateMovedInAscending.fields = [complexSortField];
            _sut.sort = sortByDateMovedInAscending;

            //when
            _sut.refresh(); //should be: 2000, 2001, 2002, 2003, 2004

            //then
            assertIndexesAre([0, 1, 2, 3, 4]);
        }

        [Test]
        public function test_simple_descending_sort_by_complex_date_fields():void
        {
            //given
            var from2000To2004:IList = generateVOs(5);
            _sut.addAll(from2000To2004); //values["address.dateMovedIn"].getYear(): 2000, 2001, 2002, 2003, 2004

            const sortByDateMovedInDescending:Sort = new Sort();
            var complexSortField:ComplexSortField = new ComplexSortField("address.dateMovedIn", false, true, false);
            complexSortField.sortCompareType = SortFieldCompareTypes.DATE;
            sortByDateMovedInDescending.fields = [complexSortField];
            _sut.sort = sortByDateMovedInDescending;

            //when
            _sut.refresh(); //should be: 2004, 2003, 2002, 2001, 2000

            //then
            assertIndexesAre([4, 3, 2, 1, 0]);
        }

        [Test]
        public function test_simple_ascending_sort_by_complex_number_fields():void
        {
            //given
            var from4To0:IList = generateVOs(5, true);
            _sut.addAll(from4To0); //values["address.houseNumber"]: 4, 3, 2, 1, 0

            const sortByHouseNumberAscending:Sort = new Sort();
            sortByHouseNumberAscending.fields = [new ComplexSortField("address.houseNumber", false, false, true)];
            _sut.sort = sortByHouseNumberAscending;

            //when
            _sut.refresh(); //should be: 0, 1, 2, 3, 4

            //then
            assertIndexesAre([0, 1, 2, 3, 4]);
        }

        [Test]
        public function test_simple_descending_sort_by_complex_number_fields():void
        {
            //given
            var from4To0:IList = generateVOs(5);
            _sut.addAll(from4To0); //values["address.houseNumber"]: 0, 1, 2, 3, 4

            const sortByHouseNumberDescending:Sort = new Sort();
            sortByHouseNumberDescending.fields = [new ComplexSortField("address.houseNumber", false, true, true)];
            _sut.sort = sortByHouseNumberDescending;

            //when
            _sut.refresh(); //should be: 4, 3, 2, 1, 0

            //then
            assertIndexesAre([4, 3, 2, 1, 0]);
        }


