aboutsummaryrefslogtreecommitdiffstats
path: root/todolist/file_store_test.go
blob: 0bd194dea6fdcb9b4ba51f9a590e53ad77d6aa2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package todolist

import (
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestFileStore(t *testing.T) {
	assert := assert.New(t)
	store := &FileStore{FileLocation: "todos.json"}
	todos := store.Load()
	assert.Equal(todos[0].Subject, "this is the first subject", "")
}

func TestSave(t *testing.T) {
	store := &FileStore{FileLocation: "todos.json"}
	todos := store.Load()
	store.Save(todos)
}