ManualTest.Confirm();
}
- //[Test]
+ [Test]
[Category("P1")]
[Description("Test Duration. Check if Duration has proper value")]
[Property("SPEC", "Tizen.Network.Bluetooth.VisibilityDurationChangedEventArgs.Duration A")]
[Property("CRITERIA", "PRO")]
[Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
[Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Go to Bluetooth in Settings and change Visibility timeout to a value in minutes or hour")]
+ [Precondition(2, "Sdb is connected as root with the target. \n>sdb root on")]
[Step(1, "Tap the Run button")]
- [Postcondition(1, "Go to Bluetooth in Settings and set Visibility timeout to Always on")]
+ [Step(2, "Run next command in the linux shell.\n>sdb shell dbus-send --system --type=signal /org/projectx/bt/adapter org.projectx.bt_event.DiscoverableTimeoutChanged int32:0 int16:0")]
+ [Step(3, "(Because there is no UX senario or entry point to set the visiable timeout, so we should generate the event using command line to pass this TCT")]
+ [Postcondition(1, "NA")]
public static async Task Duration_READ_ONLY()
{
try
{
- BluetoothHelper.LaunchVisiblityAppControl("10");
+ EventHandler<VisibilityDurationChangedEventArgs> EventHandlerVisibilityDurationChanged = null;
- await Task.Delay(5000);
-
- // PRECONDITION
- VisibilityMode mode = BluetoothAdapter.Visibility;
+ EventHandlerVisibilityDurationChanged = (sender, e) => {
+ Assert.IsInstanceOf<int>(e.Duration, "duration parameter should be of type int");
+ Log.Debug ("TCT", "[TestCase][VisibilityDurationChangedEventArgs][Duration_READ_ONLY] Pass");
+ BluetoothHelper.DisplayPassLabel("VisibilityDurationChangedEventArgs.Duration_READ_ONLY");
+ BluetoothAdapter.VisibilityDurationChanged -= EventHandlerVisibilityDurationChanged;
+ };
- // TEST CODE
- if (mode == VisibilityMode.TimeLimitedDiscoverable)
- {
- BluetoothAdapter.VisibilityDurationChanged += EventHandlerVisibilityDurationChanged;
- await ManualTest.WaitForConfirm ();
+ BluetoothAdapter.VisibilityDurationChanged += EventHandlerVisibilityDurationChanged;
- // POSTCONDITON
- BluetoothAdapter.VisibilityDurationChanged -= EventHandlerVisibilityDurationChanged;
- }
- else
- {
- Assert.Fail("Visibility mode is not properly set on the device");
- }
- }
+ await ManualTest.WaitForConfirm();
+ }
catch (NotSupportedException)
{
if (isBluetoothSupported == false)
LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Postconditions for each TEST");
}
- public static void EventHandlerVisibilityModeChanged(object sender, VisibilityModeChangedEventArgs e)
- {
- visibility = BluetoothAdapter.Visibility;
- if (e.Result == BluetoothError.None)
- {
- Log.Debug ("TCT", "[TestCase][VisibilityModeChanged][Result_READ_ONLY] Pass");
- BluetoothHelper.DisplayPassLabel("Result_READ_ONLY");
- return;
- }
- else
- {
- Assert.Fail("[TestCase][VisibilityModeChanged][Result_READ_ONLY] Failed");
- }
- if (visibility == e.Visibility)
- {
- Log.Debug ("TCT", "[TestCase][VisibilityModeChanged][Visibility_READ_ONLY] Pass");
- BluetoothHelper.DisplayPassLabel("Visibility_READ_ONLY");
- }
- else
- {
- Assert.Fail("[TestCase][VisibilityModeChanged][Visibility_READ_ONLY] Failed");
- }
- }
-
- //[Test]
+ [Test]
[Category("P1")]
[Description("Test Result. Check if Result has proper value")]
[Property("SPEC", "Tizen.Network.Bluetooth.VisibilityModeChangedEventArgs.Result A")]
[Property("CRITERIA", "PRO")]
[Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
[Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Sdb is connected as root with the target. \n>sdb root on")]
[Step(1, "Tap the Run button")]
- [Step(2, "Go to Bluetooth in Settings and change Visibility timeout value")]
+ [Step(2, "Run next command in the linux shell.\n>sdb shell dbus-send --system --type=signal /org/projectx/bt/adapter org.projectx.bt_event.DiscoverableModeChanged int32:0 int16:1")]
+ [Step(3, "(Because there is no UX senario or entry point to set the visiable mode change, so we should generate the event using command line to pass this TCT")]
[Postcondition(1, "NA")]
public static async Task Result_READ_ONLY()
{
try
{
- BluetoothAdapter.VisibilityModeChanged += EventHandlerVisibilityModeChanged;
+ EventHandler<VisibilityModeChangedEventArgs> EventHandlerVisibilityModeChanged = null;
- BluetoothHelper.LaunchVisiblityAppControl("10");
+ EventHandlerVisibilityModeChanged = (sender, e) => {
+ if (e.Result == BluetoothError.None)
+ {
+ Log.Debug ("TCT", "[TestCase][VisibilityModeChanged][Result_READ_ONLY] Pass");
+ BluetoothHelper.DisplayPassLabel("VisibilityModeChangedEventArgs.Result_READ_ONLY");
+ BluetoothAdapter.VisibilityModeChanged -= EventHandlerVisibilityModeChanged;
+ }
+ };
+
+ BluetoothAdapter.VisibilityModeChanged += EventHandlerVisibilityModeChanged;
await ManualTest.WaitForConfirm();
-
- // POSTCONDITON
- BluetoothAdapter.VisibilityModeChanged -= EventHandlerVisibilityModeChanged;
- }
+ }
catch (NotSupportedException)
{
if (isBluetoothSupported == false)
}
}
- //[Test]
+ [Test]
[Category("P1")]
[Description("Test Visibility. Check if the Visibility has correct value")]
[Property("SPEC", "Tizen.Network.Bluetooth.VisibilityModeChangedEventArgs.Visibility A")]
[Property("CRITERIA", "PRO")]
[Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
[Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Sdb is connected as root with the target. \n>sdb root on")]
[Step(1, "Tap the Run button")]
- [Step(2, "Go to Bluetooth in Settings and change Visibility timeout value")]
+ [Step(2, "Run next command in the linux shell.\n>sdb shell dbus-send --system --type=signal /org/projectx/bt/adapter org.projectx.bt_event.DiscoverableModeChanged int32:0 int16:1")]
+ [Step(3, "(Because there is no UX senario or entry point to set the visiable mode change, so we should generate the event using command line to pass this TCT")]
[Postcondition(1, "NA")]
public static async Task Visibility_READ_ONLY()
{
try
{
- BluetoothAdapter.VisibilityModeChanged += EventHandlerVisibilityModeChanged;
+ EventHandler<VisibilityModeChangedEventArgs> EventHandlerVisibilityModeChanged = null;
- BluetoothHelper.LaunchVisiblityAppControl("10");
+ EventHandlerVisibilityModeChanged = (sender, e) => {
+ Assert.IsInstanceOf<VisibilityMode>(e.Visibility, "Visibility parameter should be of type VisibilityMode");
+ Log.Debug ("TCT", "[TestCase][VisibilityModeChanged][Result_READ_ONLY] Pass");
+ BluetoothHelper.DisplayPassLabel("VisibilityModeChangedEventArgs.Result_READ_ONLY");
+ BluetoothAdapter.VisibilityModeChanged -= EventHandlerVisibilityModeChanged;
+ };
- await ManualTest.WaitForConfirm();
+ BluetoothAdapter.VisibilityModeChanged += EventHandlerVisibilityModeChanged;
- // POSTCONDITON
- BluetoothAdapter.VisibilityModeChanged -= EventHandlerVisibilityModeChanged;
- }
+ await ManualTest.WaitForConfirm();
+ }
catch (NotSupportedException)
{
if (isBluetoothSupported == false)