From b91b9d073680a0371af825238af230e9618aea12 Mon Sep 17 00:00:00 2001 From: Grant Ammons Date: Mon, 2 May 2016 07:32:05 -0400 Subject: Add archive/unarchive --- todolist/file_store_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'todolist/file_store_test.go') diff --git a/todolist/file_store_test.go b/todolist/file_store_test.go index 8817362..8bffa56 100644 --- a/todolist/file_store_test.go +++ b/todolist/file_store_test.go @@ -54,6 +54,23 @@ func TestComplete(t *testing.T) { assert.Equal(true, store.FindById(1).Completed) } +func TestArchive(t *testing.T) { + assert := assert.New(t) + store := &FileStore{FileLocation: "todos.json"} + store.Load() + assert.Equal(false, store.FindById(2).Archived) + store.Archive(2) + assert.Equal(true, store.FindById(2).Archived) +} +func TestUnarchive(t *testing.T) { + assert := assert.New(t) + store := &FileStore{FileLocation: "todos.json"} + store.Load() + assert.Equal(true, store.FindById(1).Archived) + store.Unarchive(1) + assert.Equal(false, store.FindById(1).Archived) +} + func TestUncomplete(t *testing.T) { assert := assert.New(t) store := &FileStore{FileLocation: "todos.json"} -- cgit v1.3