github.com/argoproj/argo-cd/v3@v3.2.1/applicationset/services/pull_request/fake.go (about)

     1  package pull_request
     2  
     3  import (
     4  	"context"
     5  )
     6  
     7  type FakeService struct {
     8  	listPullReuests []*PullRequest
     9  	listError       error
    10  }
    11  
    12  var _ PullRequestService = (*FakeService)(nil)
    13  
    14  func NewFakeService(_ context.Context, listPullReuests []*PullRequest, listError error) (PullRequestService, error) {
    15  	return &FakeService{
    16  		listPullReuests: listPullReuests,
    17  		listError:       listError,
    18  	}, nil
    19  }
    20  
    21  func (g *FakeService) List(_ context.Context) ([]*PullRequest, error) {
    22  	return g.listPullReuests, g.listError
    23  }