From 5c6e874a53fb5818e50cef3f9be26f63a299f3ec Mon Sep 17 00:00:00 2001 From: sinikang Date: Thu, 3 May 2018 17:53:32 +0900 Subject: [PATCH] [Telephony][Non-ACR] Added NotSupportedException handling for some manual TCs Change-Id: I039ca2e5c538cdd73d12408c0f80c18f36e6533d --- .../testcase/TSChangeNotificationEventArgs.cs | 45 ++++++++++++--------- .../testcase/TSSlotHandle.cs | 46 +++++++++++++--------- 2 files changed, 54 insertions(+), 37 deletions(-) mode change 100755 => 100644 tct-suite-vs/Tizen.Telephony.Manual.Tests/testcase/TSChangeNotificationEventArgs.cs mode change 100755 => 100644 tct-suite-vs/Tizen.Telephony.Manual.Tests/testcase/TSSlotHandle.cs diff --git a/tct-suite-vs/Tizen.Telephony.Manual.Tests/testcase/TSChangeNotificationEventArgs.cs b/tct-suite-vs/Tizen.Telephony.Manual.Tests/testcase/TSChangeNotificationEventArgs.cs old mode 100755 new mode 100644 index 14f596c..3fbf5fc --- a/tct-suite-vs/Tizen.Telephony.Manual.Tests/testcase/TSChangeNotificationEventArgs.cs +++ b/tct-suite-vs/Tizen.Telephony.Manual.Tests/testcase/TSChangeNotificationEventArgs.cs @@ -28,16 +28,33 @@ namespace Tizen.Telephony.Tests [SetUp] public static void Init() { - Tizen.Log.Info(TAG, "Executing Init"); - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); - Information.TryGetValue("http://tizen.org/feature/network.telephony", out _isTelephonySupported); - - /* Initialize Manager */ - _simList = Manager.Init(); - Assert.IsNotNull(_simList, "simList is Null"); - Assert.IsInstanceOf>(_simList, "simList is Not of IEnumerable type"); - ICollection c = _simList as ICollection; - Assert.IsTrue(c.Count != 0, "simList is Empty"); + try + { + Tizen.Log.Info(TAG, "Executing Init"); + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); + Information.TryGetValue("http://tizen.org/feature/network.telephony", out _isTelephonySupported); + + /* Initialize Manager */ + _simList = Manager.Init(); + Assert.IsNotNull(_simList, "simList is Null"); + Assert.IsInstanceOf>(_simList, "simList is Not of IEnumerable type"); + ICollection c = _simList as ICollection; + Assert.IsTrue(c.Count != 0, "simList is Empty"); + } + catch (NotSupportedException) + { + Tizen.Log.Info(TAG, "Failed Init() by NotSupportedException"); + + if (_isTelephonySupported == false) + Assert.Pass("Telephony feature is not supported"); + } + catch (Exception e) + { + Tizen.Log.Error(TAG, "Caught Exception" + e.ToString()); + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString()); + Assert.IsTrue(false, "Caught Exception" + e.ToString()); + } + } [TearDown] @@ -101,10 +118,6 @@ namespace Tizen.Telephony.Tests Tizen.Log.Info(TAG, "Completed TC:NotificationType_GET_ENUM_ALL"); } - catch (NotSupportedException) - { - Assert.IsTrue(_isTelephonySupported == false, "Invalid NotSupportedException"); - } catch (Exception e) { Tizen.Log.Error(TAG, "Caught Exception" + e.ToString()); @@ -153,10 +166,6 @@ namespace Tizen.Telephony.Tests Tizen.Log.Info(TAG, "Completed TC:NotificationData_READ_ONLY"); } - catch (NotSupportedException) - { - Assert.IsTrue(_isTelephonySupported == false, "Invalid NotSupportedException"); - } catch (Exception e) { Tizen.Log.Error(TAG, "Caught Exception" + e.ToString()); diff --git a/tct-suite-vs/Tizen.Telephony.Manual.Tests/testcase/TSSlotHandle.cs b/tct-suite-vs/Tizen.Telephony.Manual.Tests/testcase/TSSlotHandle.cs old mode 100755 new mode 100644 index e452eb6..8064b30 --- a/tct-suite-vs/Tizen.Telephony.Manual.Tests/testcase/TSSlotHandle.cs +++ b/tct-suite-vs/Tizen.Telephony.Manual.Tests/testcase/TSSlotHandle.cs @@ -22,17 +22,33 @@ namespace Tizen.Telephony.Tests [SetUp] public static void Init() { - Tizen.Log.Info(TAG, "Executing Init"); - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); - _notificationReceived = false; - Information.TryGetValue("http://tizen.org/feature/network.telephony", out _isTelephonySupported); - - /* Initialize Manager */ - _simList = Manager.Init(); - Assert.IsNotNull(_simList, "simList is Null"); - Assert.IsInstanceOf>(_simList, "simList is Not of IEnumerable type"); - ICollection c = _simList as ICollection; - Assert.IsTrue(c.Count != 0, "simList is Empty"); + try + { + Tizen.Log.Info(TAG, "Executing Init"); + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); + _notificationReceived = false; + Information.TryGetValue("http://tizen.org/feature/network.telephony", out _isTelephonySupported); + + /* Initialize Manager */ + _simList = Manager.Init(); + Assert.IsNotNull(_simList, "simList is Null"); + Assert.IsInstanceOf>(_simList, "simList is Not of IEnumerable type"); + ICollection c = _simList as ICollection; + Assert.IsTrue(c.Count != 0, "simList is Empty"); + } + catch (NotSupportedException) + { + Tizen.Log.Info(TAG, "Failed Init() by NotSupportedException"); + + if (_isTelephonySupported == false) + Assert.Pass("Telephony feature is not supported"); + } + catch (Exception e) + { + Tizen.Log.Error(TAG, "Caught Exception" + e.ToString()); + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString()); + Assert.IsTrue(false, "Caught Exception" + e.ToString()); + } } [TearDown] @@ -89,10 +105,6 @@ namespace Tizen.Telephony.Tests Tizen.Log.Info(TAG, "Completed TC:SetNotificationId_Working"); TelephonyHelper.PrintLog(Type.DLogAndlogUtil, "Completed TC:SetNotificationId_Working"); } - catch (NotSupportedException) - { - Assert.IsTrue(_isTelephonySupported == false, "Invalid NotSupportedException"); - } catch (Exception e) { TelephonyHelper.PrintLog(Type.DLogAndlogUtil, "Caught Exception" + e.ToString()); @@ -138,10 +150,6 @@ namespace Tizen.Telephony.Tests Tizen.Log.Info(TAG, "Completed TC:RemoveNotificationId_Working"); TelephonyHelper.PrintLog(Type.DLogAndlogUtil, "Completed TC:RemoveNotificationId_Working"); } - catch (NotSupportedException) - { - Assert.IsTrue(_isTelephonySupported == false, "Invalid NotSupportedException"); - } catch (Exception e) { TelephonyHelper.PrintLog(Type.DLogAndlogUtil, "Caught Exception" + e.ToString()); -- 2.7.4