blob: aefa3c662d6f010d86de3b5c924b7ab2cde8a1b6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
package simulation
import (
"testing"
"time"
"github.com/stretchr/testify/suite"
)
type NetworkModelsTestSuite struct {
suite.Suite
}
func (n *NetworkModelsTestSuite) SetupTest() {
}
func (n *NetworkModelsTestSuite) TearDownTest() {
}
// TestNormalNetwork make sure the Delay() or NormalNetwork does not
// exceeds 200ms.
func (n *NetworkModelsTestSuite) TestNormalNetwork() {
m := NormalNetwork{}
for i := 0; i < 1000; i++ {
n.Require().True(m.Delay() < 200*time.Millisecond)
}
}
func TestNetworkModels(t *testing.T) {
suite.Run(t, new(NetworkModelsTestSuite))
}
|