Skip to content

Commit 73540ca

Browse files
committed
test-case for list.go
1 parent e082987 commit 73540ca

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

hack/tools/release/notes/list_test.go

+40
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ limitations under the License.
2020
package main
2121

2222
import (
23+
"reflect"
2324
"testing"
2425

2526
. "github.com/onsi/gomega"
@@ -65,3 +66,42 @@ func Test_buildSetOfPRNumbers(t *testing.T) {
6566
})
6667
}
6768
}
69+
70+
func Test_githubFromToPRLister_listPRs(t *testing.T) {
71+
type fields struct {
72+
client *githubClient
73+
fromRef ref
74+
toRef ref
75+
branch string
76+
}
77+
type args struct {
78+
previousReleaseRef ref
79+
}
80+
tests := []struct {
81+
name string
82+
fields fields
83+
args args
84+
want []pr
85+
wantErr bool
86+
}{
87+
// TODO: Add test cases.
88+
}
89+
for _, tt := range tests {
90+
t.Run(tt.name, func(t *testing.T) {
91+
l := &githubFromToPRLister{
92+
client: tt.fields.client,
93+
fromRef: tt.fields.fromRef,
94+
toRef: tt.fields.toRef,
95+
branch: tt.fields.branch,
96+
}
97+
got, err := l.listPRs(tt.args.previousReleaseRef)
98+
if (err != nil) != tt.wantErr {
99+
t.Errorf("githubFromToPRLister.listPRs() error = %v, wantErr %v", err, tt.wantErr)
100+
return
101+
}
102+
if !reflect.DeepEqual(got, tt.want) {
103+
t.Errorf("githubFromToPRLister.listPRs() = %v, want %v", got, tt.want)
104+
}
105+
})
106+
}
107+
}

0 commit comments

Comments
 (0)