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