github.com/anjalikarhana/fabric@v2.1.1+incompatible/orderer/consensus/inactive/inactive_chain_test.go (about) 1 /* 2 Copyright IBM Corp. 2017 All Rights Reserved. 3 4 SPDX-License-Identifier: Apache-2.0 5 */ 6 7 package inactive_test 8 9 import ( 10 "testing" 11 12 "github.com/hyperledger/fabric/orderer/consensus/inactive" 13 "github.com/pkg/errors" 14 "github.com/stretchr/testify/assert" 15 ) 16 17 func TestInactiveChain(t *testing.T) { 18 err := errors.New("foo") 19 chain := &inactive.Chain{Err: err} 20 21 assert.Equal(t, err, chain.Order(nil, 0)) 22 assert.Equal(t, err, chain.Configure(nil, 0)) 23 assert.Equal(t, err, chain.WaitReady()) 24 assert.NotPanics(t, chain.Start) 25 assert.NotPanics(t, chain.Halt) 26 _, open := <-chain.Errored() 27 assert.False(t, open) 28 }