| // Copyright 2022 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| // NewFakeClient returns a fake Client suitable for testing. |
| func NewFakeClient() Client { |
| issues: map[int]*Issue{}, |
| func (c *fakeClient) Destination() string { |
| func (c *fakeClient) Reference(num int) string { |
| return fmt.Sprintf("inMemory#%d", num) |
| func (c *fakeClient) GetIssue(_ context.Context, number int) (*Issue, error) { |
| return &Issue{Title: "Hello"}, nil |
| func (c *fakeClient) IssueExists(_ context.Context, number int) (bool, error) { |
| _, ok := c.issues[number] |
| func (c *fakeClient) CreateIssue(_ context.Context, iss *Issue) (number int, err error) { |