From: sinikang Date: Thu, 3 May 2018 08:53:32 +0000 (+0900) Subject: [Telephony][Non-ACR] Added NotSupportedException handling for some manual TCs X-Git-Tag: public_m1_final~61^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F46%2F177746%2F2;p=test%2Ftct%2Fcsharp%2Fapi.git [Telephony][Non-ACR] Added NotSupportedException handling for some manual TCs Change-Id: I039ca2e5c538cdd73d12408c0f80c18f36e6533d --- 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 14f596cc2..3fbf5fc41 --- 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 e452eb629..8064b3070 --- 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());