aboutsummaryrefslogtreecommitdiffstats
path: root/todolist/file_store_test.go
blob: 8de79ec1b38370c19c799477084efb144a5a980b (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)
}