it-chain icon indicating copy to clipboard operation
it-chain copied to clipboard

[Consensus] HandleStartConsensusCommand test 문의

Open sinramyeon opened this issue 6 years ago • 1 comments


func TestStartConsensusCommandHandler_HandleStartConsensusCommand(t *testing.T) {
	//mockStateApi := newMockStateApi(nil)
	//testHandler := adapter.NewStartConsensusCommandHandler(mockStateApi)
	//
	//// case 1 : success
	//expectedSeal := []byte{'s', 'e', 'a', 'l'}
	//expectedTxList := []event.Tx{}
	//for i := 0; i < 5; i++ {
	//	expectedTxList = append(expectedTxList, event.Tx{
	//		ID: string(i),
	//	})
	//}
	//
	//expectedCommand := event.BlockCreated{
	//	Seal:   expectedSeal,
	//	TxList: expectedTxList,
	//}
	//
	//testResult, testErr := testHandler.HandleStartConsensusCommand(expectedCommand)
	//
	//assert.True(t, testResult)
	//assert.Equal(t, "", testErr.Message)
	//
	//// case 2 : consensus on error
	//consensusStartError := errors.New("on consensus failed!")
	//mockStateApi = newMockStateApi(consensusStartError)
	//testHandler = adapter.NewStartConsensusCommandHandler(mockStateApi)
	//
	//testResult, testErr = testHandler.HandleStartConsensusCommand(expectedCommand)
	//
	//assert.False(t, testResult)
	//assert.Equal(t, consensusStartError.Error(), testErr.Message)
}

consensus 쪽의 TestStartConsensusCommandHandler_HandleStartConsensusCommand 테스트 함수 처리가 주석 되어 있는데 어떤 이유가 있는 건가요??

sinramyeon avatar Nov 05 '18 02:11 sinramyeon

@hihiboss

hea9549 avatar Nov 14 '18 01:11 hea9549