From: Wootak Jung Date: Tue, 24 Mar 2020 06:46:40 +0000 (+0900) Subject: [Bluetooth][Non-ACR] Add nagative TC X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3eb50c2a3b4178b4a82add6ab473c7d3fc7af0d9;p=test%2Ftct%2Fcsharp%2Fapi.git [Bluetooth][Non-ACR] Add nagative TC Change-Id: I25736daf3661115f96ffda0c46a8282f62075aa7 --- diff --git a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSIBluetoothServerSocket.cs b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSIBluetoothServerSocket.cs index aaa294d..3eb166f 100644 --- a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSIBluetoothServerSocket.cs +++ b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSIBluetoothServerSocket.cs @@ -214,6 +214,59 @@ namespace Tizen.Network.Bluetooth.Tests } [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(() => + { + 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")]