本文整理匯總了Golang中github.com/cloudfoundry/gunk/timeprovider/faketimeprovider.FakeTimeProvider類的典型用法代碼示例。如果您正苦於以下問題:Golang FakeTimeProvider類的具體用法?Golang FakeTimeProvider怎麽用?Golang FakeTimeProvider使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了FakeTimeProvider類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
. "github.com/cloudfoundry/hm9000/testhelpers/custommatchers"
"github.com/cloudfoundry/hm9000/testhelpers/fakelogger"
"github.com/cloudfoundry/storeadapter/fakestoreadapter"
"github.com/cloudfoundry/yagnats/fakeyagnats"
. "github.com/cloudfoundry/hm9000/evacuator"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Evacuator", func() {
var (
evacuator *Evacuator
messageBus *fakeyagnats.FakeNATSConn
storeAdapter *fakestoreadapter.FakeStoreAdapter
timeProvider *faketimeprovider.FakeTimeProvider
store storepackage.Store
app appfixture.AppFixture
)
conf, _ := config.DefaultConfig()
BeforeEach(func() {
storeAdapter = fakestoreadapter.New()
messageBus = fakeyagnats.Connect()
store = storepackage.NewStore(conf, storeAdapter, fakelogger.NewFakeLogger())
timeProvider = &faketimeprovider.FakeTimeProvider{
TimeToProvide: time.Unix(100, 0),
}
示例2:
"github.com/cloudfoundry/hm9000/testhelpers/appfixture"
"github.com/cloudfoundry/hm9000/testhelpers/fakelogger"
"github.com/cloudfoundry/hm9000/testhelpers/fakemetricsaccountant"
"github.com/cloudfoundry/storeadapter/fakestoreadapter"
"github.com/cloudfoundry/yagnats/fakeyagnats"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Sender", func() {
var (
storeAdapter *fakestoreadapter.FakeStoreAdapter
store storepackage.Store
sender *Sender
messageBus *fakeyagnats.FakeYagnats
timeProvider *faketimeprovider.FakeTimeProvider
dea appfixture.DeaFixture
app appfixture.AppFixture
conf *config.Config
metricsAccountant *fakemetricsaccountant.FakeMetricsAccountant
)
BeforeEach(func() {
messageBus = fakeyagnats.New()
dea = appfixture.NewDeaFixture()
app = dea.GetApp(0)
conf, _ = config.DefaultConfig()
metricsAccountant = fakemetricsaccountant.New()
timeProvider = &faketimeprovider.FakeTimeProvider{
TimeToProvide: time.Unix(int64(10+conf.ActualFreshnessTTL()), 0),
示例3:
"github.com/cloudfoundry/hm9000/testhelpers/fakelogger"
"github.com/cloudfoundry/hm9000/testhelpers/fakemetricsaccountant"
"github.com/cloudfoundry/hm9000/testhelpers/fakeusagetracker"
"github.com/cloudfoundry/storeadapter/fakestoreadapter"
"github.com/cloudfoundry/yagnats/fakeyagnats"
)
var _ = Describe("Actual state listener", func() {
var (
app AppFixture
anotherApp AppFixture
dea DeaFixture
store storepackage.Store
storeAdapter *fakestoreadapter.FakeStoreAdapter
listener *ActualStateListener
timeProvider *faketimeprovider.FakeTimeProvider
messageBus *fakeyagnats.FakeYagnats
logger *fakelogger.FakeLogger
conf *config.Config
freshByTime time.Time
usageTracker *fakeusagetracker.FakeUsageTracker
metricsAccountant *fakemetricsaccountant.FakeMetricsAccountant
)
BeforeEach(func() {
var err error
conf, err = config.DefaultConfig()
Ω(err).ShouldNot(HaveOccurred())
timeProvider = faketimeprovider.New(time.Unix(100, 0))
示例4:
"errors"
"github.com/cloudfoundry/gunk/timeprovider/faketimeprovider"
"github.com/cloudfoundry/hm9000/config"
"github.com/cloudfoundry/hm9000/models"
storepackage "github.com/cloudfoundry/hm9000/store"
"github.com/cloudfoundry/hm9000/testhelpers/appfixture"
"github.com/cloudfoundry/hm9000/testhelpers/fakelogger"
"github.com/cloudfoundry/storeadapter/fakestoreadapter"
"time"
)
var _ = Describe("Analyzer", func() {
var (
analyzer *Analyzer
storeAdapter *fakestoreadapter.FakeStoreAdapter
store storepackage.Store
timeProvider *faketimeprovider.FakeTimeProvider
dea appfixture.DeaFixture
app appfixture.AppFixture
)
conf, _ := config.DefaultConfig()
BeforeEach(func() {
storeAdapter = fakestoreadapter.New()
store = storepackage.NewStore(conf, storeAdapter, fakelogger.NewFakeLogger())
timeProvider = &faketimeprovider.FakeTimeProvider{}
timeProvider.TimeToProvide = time.Unix(1000, 0)
dea = appfixture.NewDeaFixture()
app = dea.GetApp(0)