Files
webrtc/rtcconfiguration_test.go
2018-07-16 14:20:18 -07:00

28 lines
596 B
Go

package webrtc
import (
"testing"
"time"
)
func TestRTCCertificate(t *testing.T) {
t.Run("Equals", func(t *testing.T) {
now := time.Now()
testCases := []struct {
first RTCCertificate
second RTCCertificate
expected bool
}{
{RTCCertificate{expires: now}, RTCCertificate{expires: now}, true},
{RTCCertificate{expires: now}, RTCCertificate{}, false},
}
for i, testCase := range testCases {
equal := testCase.first.Equals(testCase.second)
if equal != testCase.expected {
t.Errorf("Case %d: expected %t got %t", i, testCase.expected, equal)
}
}
})
}