diff --git a/candidate_test.go b/candidate_test.go index 16c9900..e3d41f6 100644 --- a/candidate_test.go +++ b/candidate_test.go @@ -1,6 +1,11 @@ package ice -import "testing" +import ( + "testing" + "time" + + "github.com/stretchr/testify/assert" +) func TestCandidatePriority(t *testing.T) { for _, test := range []struct { @@ -49,3 +54,19 @@ func TestCandidatePriority(t *testing.T) { } } } + +func TestCandidateLastSent(t *testing.T) { + candidate := candidateBase{} + assert.Equal(t, candidate.LastSent(), time.Time{}) + now := time.Now() + candidate.setLastSent(now) + assert.Equal(t, candidate.LastSent(), now) +} + +func TestCandidateLastReceived(t *testing.T) { + candidate := candidateBase{} + assert.Equal(t, candidate.LastReceived(), time.Time{}) + now := time.Now() + candidate.setLastReceived(now) + assert.Equal(t, candidate.LastReceived(), now) +}