Assert.That(await tcsDataChannelMessageReceived.Task, "Event should be raised");
}
+
+ [Test]
+ [Category("P1")]
+ [Description("Check whether BufferedAmountLow event is invoked or not.")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.WebRTCDataChannel.BufferedAmountLow E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task BufferedAmountLow_CHECK_EVENT()
+ {
+ var greetingMessage = "BufferedAmountLow event check message.";
+
+ var tcsDataChannel = new TaskCompletionSource<WebRTCDataChannel>(TaskCreationOptions.RunContinuationsAsynchronously);
+ var tcsDataChannelBufferedAmountLow = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
+
+ _answerClient.DataChannel += (s, e) =>
+ {
+ // DataChannel from peer
+ tcsDataChannel.TrySetResult(e.DataChannel);
+ };
+
+ await _offerClient.StartAsync();
+ await _answerClient.StartAsync();
+
+ await ConnectPeerAsync(_offerClient, _answerClient);
+
+ var answerDataChannel = await tcsDataChannel.Task;
+
+ await _tcsAnswerTrackAdded.Task;
+
+ _offerDataChannel.BufferedAmountLowThreshold = 10;
+ _offerDataChannel.BufferedAmountLow += (s, e) =>
+ {
+ tcsDataChannelBufferedAmountLow.TrySetResult(true);
+ };
+
+ _offerDataChannel.Send(greetingMessage);
+
+ Assert.That(await tcsDataChannelBufferedAmountLow.Task, "Event should be raised");
+ }
}
}
\ No newline at end of file
Assert.That(() => webRtcDataChannel.Send(data), Throws.TypeOf<ObjectDisposedException>(),
"Should throw ObjectDisposedException");
}
+
+ [Test]
+ [Category("P1")]
+ [Description("Check whether BufferedAmount returns expected value or not.")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.WebRTCDataChannel.BufferedAmount A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void BufferedAmount_READ_ONLY()
+ {
+ using (var webRtcDataChannel = new WebRTCDataChannel(_webRtc, "test"))
+ {
+ Assert.That(() => webRtcDataChannel.BufferedAmount, Is.GreaterThanOrEqualTo(0),
+ "Should be greater than or equal to zero");
+ AssertHelper.PropertyReadOnly<WebRTCDataChannel>(nameof(WebRTCDataChannel.BufferedAmount));
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether BufferedAmount throw ObjectDisposedException or not.")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.WebRTCDataChannel.BufferedAmount A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void BufferedAmount_THROWS_IF_ALREADY_DISPOSED()
+ {
+ var webRtcDataChannel = new WebRTCDataChannel(_webRtc, "test");
+ webRtcDataChannel.Dispose();
+
+ Assert.That(() => webRtcDataChannel.BufferedAmount, Throws.TypeOf<ObjectDisposedException>(),
+ "Should throw ObjectDisposedException");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check whether BufferedAmountLowThreshold returns expected value or not.")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.WebRTCDataChannel.BufferedAmountLowThreshold A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void BufferedAmountLowThreshold_READ_WRITE()
+ {
+ using (var webRtcDataChannel = new WebRTCDataChannel(_webRtc, "test"))
+ {
+ Assert.That(() => webRtcDataChannel.BufferedAmountLowThreshold = 10, Throws.Nothing,
+ "Default value should be zero.");
+
+ Assert.That(() => webRtcDataChannel.BufferedAmountLowThreshold, Is.EqualTo(10),
+ "Default value should be zero.");
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check whether BufferedAmountLowThreshold returns expected value or not.")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.WebRTCDataChannel.BufferedAmountLowThreshold A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PDV")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void BufferedAmountLowThreshold_CHECK_DEFAULT_VALUE()
+ {
+ using (var webRtcDataChannel = new WebRTCDataChannel(_webRtc, "test"))
+ {
+ Assert.That(webRtcDataChannel.BufferedAmountLowThreshold, Is.EqualTo(0),
+ "Default value should be zero.");
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether BufferedAmountLowThreshold throw ObjectDisposedException or not.")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.WebRTCDataChannel.BufferedAmountLowThreshold A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void BufferedAmountLowThreshold_THROWS_IF_ALREADY_DISPOSED()
+ {
+ var webRtcDataChannel = new WebRTCDataChannel(_webRtc, "test");
+ webRtcDataChannel.Dispose();
+
+ Assert.That(() => webRtcDataChannel.BufferedAmountLowThreshold, Throws.TypeOf<ObjectDisposedException>(),
+ "Should throw ObjectDisposedException");
+
+ Assert.That(() => webRtcDataChannel.BufferedAmountLowThreshold = 10, Throws.TypeOf<ObjectDisposedException>(),
+ "Should throw ObjectDisposedException");
+ }
}
}
\ No newline at end of file