예제 #1
0
func Test_Todos(t *testing.T) {
	expected := `* todo todo todo` + "\n\n"

	got := new(bytes.Buffer)
	Todos(got, testhelper.GetTestProject("A", 1, 1).Todos())

	testhelper.CompareGotExpected(t, nil, got.String(), expected)
}
예제 #2
0
func Test_Notes(t *testing.T) {
	expected := `== 2010-11-10 23:00:00
note note note` + "\n\n"

	got := new(bytes.Buffer)
	Notes(got, 2, testhelper.GetTestProject("A", 1, 1).Notes())

	testhelper.CompareGotExpected(t, nil, got.String(), expected)
}
예제 #3
0
func Test_ProjectTodos(t *testing.T) {
	expected := `= Test.Project.A
* todo todo todo` + "\n\n"

	got := new(bytes.Buffer)
	project := testhelper.GetTestProject("A", 1, 1)
	ProjectTodos(got, 0, &project)

	testhelper.CompareGotExpected(t, nil, got.String(), expected)
}
예제 #4
0
func Test_ProjectNoNotesNoTodos(t *testing.T) {
	expected := ``

	got := new(bytes.Buffer)

	project := testhelper.GetTestProject("A", 0, 0)
	Project(got, 0, &project)

	testhelper.CompareGotExpected(t, nil, got.String(), expected)
}
예제 #5
0
func Test_TodosDone(t *testing.T) {
	expected := ``

	got := new(bytes.Buffer)
	todos := testhelper.GetTestProject("A", 1, 1).Todos()
	todos[0].Active = false

	Todos(got, todos)

	testhelper.CompareGotExpected(t, nil, got.String(), expected)
}
예제 #6
0
func Test_ProjectNotes(t *testing.T) {
	expected := `= Test.Project.A
== 2010-11-10 23:00:00
note note note` + "\n\n"

	got := new(bytes.Buffer)
	project := testhelper.GetTestProject("A", 1, 1)
	ProjectNotes(got, 0, &project)

	testhelper.CompareGotExpected(t, nil, got.String(), expected)
}
예제 #7
0
func Test_NotesValue(t *testing.T) {
	expected := `== 2010-11-10 23:00:00
=== Header In Note Value
note note note

==== SubHeader In Note Value
note note note` + "\n\n"

	value := `= Header In Note Value
note note note

== SubHeader In Note Value
note note note`

	got := new(bytes.Buffer)

	project := testhelper.GetTestProject("A", 0, 0)
	project.AddNote(testhelper.GetTestNote(0, value))

	Notes(got, 2, project.Notes())

	testhelper.CompareGotExpected(t, nil, got.String(), expected)
}