コード例 #1
0
ファイル: mother.go プロジェクト: dieucao/notifications
func (m *Mother) NotificationsFinder() services.NotificationsFinder {
	clientsRepo, kindsRepo := m.Repos()
	return services.NewNotificationsFinder(clientsRepo, kindsRepo)
}
コード例 #2
0
	. "github.com/onsi/gomega"
)

var _ = Describe("NotificationsFinder", func() {
	var (
		finder      services.NotificationsFinder
		clientsRepo *mocks.ClientsRepository
		kindsRepo   *mocks.KindsRepo
		database    *mocks.Database
	)

	BeforeEach(func() {
		clientsRepo = mocks.NewClientsRepository()
		kindsRepo = mocks.NewKindsRepo()
		database = mocks.NewDatabase()
		finder = services.NewNotificationsFinder(clientsRepo, kindsRepo)
	})

	Describe("ClientAndKind", func() {
		BeforeEach(func() {
			clientsRepo.FindCall.Returns.Client = models.Client{
				ID: "some-client-id",
			}

			kindsRepo.FindCall.Returns.Kinds = []models.Kind{
				{
					ID:       "perimeter_breach",
					ClientID: "some-client-id",
				},
			}
		})