@@ -0,0 +1,2591 @@
+/* PropertySortDescriptorTests.java created on Dec 5, 2015.%0D%0A *%0D%0A * Copyright (c) %3C2015%3E Pin-Ying Tu %3Cdbi1463@gmail.com%3E%0D%0A * %0D%0A * This file is part of SortDescriptor under the MIT license.%0D%0A * %0D%0A * Permission is hereby granted, free of charge, to any person obtaining a copy%0D%0A * of this software and associated documentation files (the %22Software%22), to deal%0D%0A * in the Software without restriction, including without limitation the rights%0D%0A * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell%0D%0A * copies of the Software, and to permit persons to whom the Software is%0D%0A * furnished to do so, subject to the following conditions:%0D%0A * %0D%0A * The above copyright notice and this permission notice shall be included in%0D%0A * all copies or substantial portions of the Software.%0D%0A * %0D%0A * THE SOFTWARE IS PROVIDED %22AS IS%22, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR%0D%0A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,%0D%0A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE%0D%0A * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER%0D%0A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,%0D%0A * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN%0D%0A * THE SOFTWARE.%0D%0A */%0D%0Apackage tw.funnymph.commons.sort;%0D%0A%0D%0Aimport static org.junit.Assert.*;%0D%0A%0D%0Aimport org.junit.Test;%0D%0A%0D%0Aimport tw.funnymph.commons.sort.Person.Gender;%0D%0A%0D%0A/**%0D%0A * This class tests the functionalities of %7B@link PropertySortDescriptor%7D.%0D%0A * %0D%0A * @author Pin-Ying Tu%0D%0A * @version 1.0%0D%0A * @since 1.0%0D%0A */%0D%0Apublic class PropertySortDescriptorTests %7B%0D%0A%0D%0A%09@Test%0D%0A%09public void testPropertySortDescriptor() %7B%0D%0A%09%09PropertySortDescriptor%3CPerson%3E testee = new PropertySortDescriptor%3CPerson%3E(%22lastName%22);%0D%0A%09%09Person person = new Person(%22Cathy%22, %22Tu%22, Gender.Female, SortExample.getBirthday(30, 2, 2));%0D%0A%09%09assertTrue(testee.isAscending());%0D%0A%09%09assertEquals(%22Tu%22, testee.transform(person));%0D%0A%09%7D%0D%0A%0D%0A%09@Test%0D%0A%09public void testPropertySortDescriptorStringBooleanBoolean() %7B%0D%0A%09%09PropertySortDescriptor%3CPerson%3E testee = new PropertySortDescriptor%3CPerson%3E(%22adult%22, true);%0D%0A%09%09Person person = new Person(%22Cathy%22, %22Tu%22, Gender.Female, SortExample.getBirthday(30, 2, 2));%0D%0A%09%09assertTrue(testee.isAscending());%0D%0A%09%09assertNull(testee.transform(person));%0D%0A%0D%0A%09%09testee = new PropertySortDescriptor%3CPerson%3E(%22firstName%22);%0D%0A%09%09assertEquals(%22Cathy%22, testee.transform(person));%0D%0A%0D%0A%09%09testee.setGetterMethodPrefix(null);%0D%0A%09%09assertNull(testee.transform(person));%0D%0A%0D%0A%09%09testee.setGetterMethodPrefix(%22%22);%0D%0A%09%09assertNull(testee.transform(person));%0D%0A%09%7D%0D%0A%7D%0D%0A

Add test cases for PropertySortDescriptor.