mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 01:08:50 -06:00
@@ -55,6 +55,7 @@ public class MemoryHabitList extends HabitList
|
||||
super(matcher);
|
||||
this.parent = parent;
|
||||
this.comparator = comparator;
|
||||
this.order = parent.order;
|
||||
parent.getObservable().addListener(this::loadFromParent);
|
||||
loadFromParent();
|
||||
}
|
||||
|
||||
@@ -31,8 +31,7 @@ import static junit.framework.TestCase.assertFalse;
|
||||
import static org.hamcrest.CoreMatchers.*;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.isoron.uhabits.core.models.HabitList.Order.*;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
@SuppressWarnings("JavaDoc")
|
||||
public class HabitListTest extends BaseUnitTest
|
||||
@@ -223,6 +222,17 @@ public class HabitListTest extends BaseUnitTest
|
||||
habitList.reorder(h1, h2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOrder_inherit()
|
||||
{
|
||||
habitList.setOrder(BY_COLOR_ASC);
|
||||
HabitList filteredList = habitList.getFiltered(new HabitMatcherBuilder()
|
||||
.setArchivedAllowed(false)
|
||||
.setCompletedAllowed(false)
|
||||
.build());
|
||||
assertEquals(filteredList.getOrder(), BY_COLOR_ASC);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWriteCSV() throws IOException
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user