mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-24 15:55:14 +00:00
25 lines
631 B
Go
25 lines
631 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, persistenceServiceFacade, isolation.persistenceServiceFacade)
|
|
}
|