package aoiprxkit

import "testing"

func TestParseMinimalSDP(t *testing.T) {
	sdp := `v=0
o=- 1 1 IN IP4 192.168.1.10
s=Test
c=IN IP4 239.69.0.1/32
t=0 0
m=audio 5004 RTP/AVP 97
a=rtpmap:97 L24/48000/2
a=ptime:1
`
	got, err := ParseMinimalSDP(sdp)
	if err != nil {
		t.Fatalf("unexpected err: %v", err)
	}
	if got.MulticastGroup != "239.69.0.1" || got.Port != 5004 || got.PayloadType != 97 || got.Encoding != "L24" || got.SampleRateHz != 48000 || got.Channels != 2 || got.PacketTimeMS != 1 {
		t.Fatalf("unexpected parsed SDP: %+v", got)
	}
}
