diff options
| author | Grant Ammons <gammons@gmail.com> | 2017-03-07 08:12:35 -0500 |
|---|---|---|
| committer | Grant Ammons <gammons@gmail.com> | 2017-03-07 08:12:35 -0500 |
| commit | 5763376a7ef50a116f9585ffd280bbf8e37621d3 (patch) | |
| tree | 8dc6d5376e1bf422a1aa693c27f505721741a1f0 /todolist/todo_list_test.go | |
| parent | 871fb90b26a98ee3569c325940a5f4e380631c54 (diff) | |
| parent | 34931b46ed9ebb06e9555d6e62c98c70dc460d59 (diff) | |
Merge branch 'master' into garbage-collect
Diffstat (limited to 'todolist/todo_list_test.go')
| -rw-r--r-- | todolist/todo_list_test.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/todolist/todo_list_test.go b/todolist/todo_list_test.go index eb0bc84..eefd99c 100644 --- a/todolist/todo_list_test.go +++ b/todolist/todo_list_test.go @@ -128,3 +128,23 @@ func TestGarbageCollect(t *testing.T) { assert.Equal(1, list.NextId()) assert.Equal(2, list.MaxId()) } + +func TestPrioritizeNotInTodosJson(t *testing.T) { + assert := assert.New(t) + store := &FileStore{FileLocation: "todos.json"} + list := &TodoList{} + todos, _ := store.Load() + list.Load(todos) + assert.Equal(false, list.FindById(2).IsPriority) +} + +func TestPrioritizeTodo(t *testing.T) { + assert := assert.New(t) + list := &TodoList{} + todo := &Todo{Archived: false, Completed: false, Subject: "testing", IsPriority: false} + list.Add(todo) + list.Prioritize(1) + assert.Equal(true, list.FindById(1).IsPriority) + list.Unprioritize(1) + assert.Equal(false, list.FindById(1).IsPriority) +} |
