}
[Test]
+ [Category("P2")]
+ [Description("Check if SendData returns proper error")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.IBluetoothServerSocket.SendData M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Adhavan, adhavan.m@samsung.com")]
+ [Property("COVPARAM", "byte[]")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Run this only on server device")]
+ [Precondition(3, "Test device(server) should be paired only with client device")]
+ [Step(1, "Tap the Run button in server device")]
+ [Step(2, "Run IBluetoothServerSocketTests.DataReceived_CLIENT_EVENT in the client device immediately")]
+ public async Task SendData_CHECK_EXCEPTION()
+ {
+ try
+ {
+ int writtenLength;
+ byte[] sendData = null;
+
+ /* We can't occupy the precondition, if BT feature is not supported in Manual TC */
+ if (_isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("SendData_SEND_DATA_TEST_SERVER");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ BluetoothSetup.CreateServerSocketUtil();
+ await BluetoothSetup.AcceptSocketUtil();
+ await Task.Delay(2000);
+ Assert.Throws<NullReferenceException>(() =>
+ {
+ writtenLength = BluetoothSetup.Socket.SendData(sendData);
+ }, "SendData should throw NullReferenceException");
+ }
+ catch (Exception ex)
+ {
+ if (ex is NotSupportedException)
+ {
+ Assert.IsTrue(_isBluetoothSupported == false, "Invalid NotSupportedException");
+ }
+ else
+ {
+ Assert.Fail("Throwing exception " + ex.ToString());
+ }
+ }
+ finally
+ {
+ BluetoothSetup.DestroyServerSocketUtil();
+ }
+ }
+
+ [Test]
[Category("P1")]
[Description("Sends data to the connected device")]
[Property("SPEC", "Tizen.Network.Bluetooth.IBluetoothServerSocket.SendData M")]