The core protocol of WoopChain
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
woop/node/service_test.go

33 lines
612 B

package node
import (
"fmt"
"testing"
"time"
)
type SupportSyncingTest struct{}
func (s *SupportSyncingTest) Start() {
fmt.Println("SupportSyncingTest starting")
}
func (s *SupportSyncingTest) Stop() {
fmt.Println("SupportSyncingTest stopping")
}
// Test TakeAction.
func TestTakeAction(t *testing.T) {
node := &Node{}
node.Start()
node.RegisterService(SupportSyncing, &SupportSyncingTest{})
for i := 0; i < 2; i++ {
select {
case <-time.After(WaitForStatusUpdate):
node.SendAction(&Action{action: Start, serviceType: SupportSyncing})
}
}
node.SendAction(&Action{serviceType: Done})
}