From 2daadbd54ad20137e9e84d5f1330b7094b5a5d65 Mon Sep 17 00:00:00 2001 From: Wootak Jung Date: Tue, 24 Mar 2020 15:46:40 +0900 Subject: [PATCH] [Bluetooth][Non-ACR] Add nagative TC Change-Id: I25736daf3661115f96ffda0c46a8282f62075aa7 --- .../testcase/TSIBluetoothServerSocket.cs | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) 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 aaa294d04..3eb166f60 100644 --- a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSIBluetoothServerSocket.cs +++ b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSIBluetoothServerSocket.cs @@ -213,6 +213,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")] -- 2.34.1