mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-14 02:53:50 +00:00
25 lines
638 B
Go
25 lines
638 B
Go
package bbgo
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestGetIsolationFromContext(t *testing.T) {
|
|
ctx := context.Background()
|
|
isolation := GetIsolationFromContext(ctx)
|
|
assert.NotNil(t, isolation)
|
|
assert.NotNil(t, isolation.persistenceServiceFacade)
|
|
assert.NotNil(t, isolation.gracefulShutdown)
|
|
}
|
|
|
|
func TestNewDefaultIsolation(t *testing.T) {
|
|
isolation := NewDefaultIsolation()
|
|
assert.NotNil(t, isolation)
|
|
assert.NotNil(t, isolation.persistenceServiceFacade)
|
|
assert.NotNil(t, isolation.gracefulShutdown)
|
|
assert.Equal(t, defaultPersistenceServiceFacade, isolation.persistenceServiceFacade)
|
|
}
|