Example #1
0
func configure(name string) offers.Configuration {
	return offers.Configuration{Name: name, OfferRepository: offer.NewRepository(mockgossie.NewMockConnectionPool())}
}
Example #2
0
func TestRemote(t *testing.T) {
	// Service
	var service = offers.Offers{Configuration: offers.Configuration{OfferRepository: offer.NewRepository(mockgossie.NewMockConnectionPool())}}

	// Server
	var server = offers.MustNewServer(offers.Configuration{}, service, ":5000")
	go func() {
		if err := server.Start(); err != nil {
			panic(err)
		}
	}()

	// Client
	var client = offers.MustNewClient(offers.Configuration{}, ":5000")

	suite.Run(t, &offers.Suite{Interface: func() offers.Interface {
		return client
	}})

	// Client
	if err := client.Close(); err != nil {
		panic(err)
	}

	// Server
	if err := server.Stop(); err != nil {
		panic(err)
	}
}
Example #3
0
func Test(t *testing.T) {
	suite.Run(t, &Suite{Interface: func() Interface {
		return Service{Configuration: Configuration{OfferRepository: offer.NewRepository(mockgossie.NewMockConnectionPool())}}
	}})
}
Example #4
0
func TestLocal(t *testing.T) {
	suite.Run(t, &offers.Suite{Interface: func() offers.Interface {
		return offers.Offers{Configuration: offers.Configuration{OfferRepository: offer.NewRepository(mockgossie.NewMockConnectionPool())}}
	}})
}