From d656d47009f23c02ac8999f18f40f52e6ea417f9 Mon Sep 17 00:00:00 2001 From: Woodrow Douglass Date: Mon, 29 Jun 2020 09:27:38 -0400 Subject: [PATCH] Test for MediaDescription.WithFingerprint This tests that an attribute is added, and the key and value of that attribute are as expected. --- media_description_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 media_description_test.go diff --git a/media_description_test.go b/media_description_test.go new file mode 100644 index 0000000..eb5bcfa --- /dev/null +++ b/media_description_test.go @@ -0,0 +1,20 @@ +package sdp + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestWithFingerprint(t *testing.T) { + m := new(MediaDescription) + + assert.Equal(t, []Attribute(nil), m.Attributes) + + m = m.WithFingerprint("testalgorithm", "testfingerprint") + + assert.Equal(t, []Attribute{ + {"fingerprint", "testalgorithm testfingerprint"}, + }, + m.Attributes) +}