MCPcopy Create free account
hub / github.com/driangle/taskmd / TestTask_IsValid

Function TestTask_IsValid

sdk/go/model/task_test.go:86–121  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

84}
85
86func TestTask_IsValid(t *testing.T) {
87 tests := []struct {
88 name string
89 task Task
90 want bool
91 }{
92 {
93 name: "both ID and Title set",
94 task: Task{ID: "001", Title: "My Task"},
95 want: true,
96 },
97 {
98 name: "missing ID",
99 task: Task{Title: "My Task"},
100 want: false,
101 },
102 {
103 name: "missing Title",
104 task: Task{ID: "001"},
105 want: false,
106 },
107 {
108 name: "both empty",
109 task: Task{},
110 want: false,
111 },
112 }
113
114 for _, tt := range tests {
115 t.Run(tt.name, func(t *testing.T) {
116 if got := tt.task.IsValid(); got != tt.want {
117 t.Errorf("Task.IsValid() = %v, want %v", got, tt.want)
118 }
119 })
120 }
121}
122
123func TestTask_GetGroup(t *testing.T) {
124 t.Run("with group set", func(t *testing.T) {

Callers

nothing calls this directly

Calls 1

IsValidMethod · 0.45

Tested by

no test coverage detected