[Bluetooth][Non-ACR] Add nagative TC 65/233965/1
authorWootak Jung <wootak.jung@samsung.com>
Tue, 24 Mar 2020 06:46:40 +0000 (15:46 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 21 May 2020 01:45:43 +0000 (10:45 +0900)
Change-Id: I25736daf3661115f96ffda0c46a8282f62075aa7

tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSIBluetoothServerSocket.cs

index aaa294d..3eb166f 100644 (file)
@@ -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<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")]