[Telephony][Non-ACR] Added NotSupportedException handling for some manual TCs 46/177746/2
authorsinikang <sinikang@samsung.com>
Thu, 3 May 2018 08:53:32 +0000 (17:53 +0900)
committersinikang <sinikang@samsung.com>
Fri, 4 May 2018 04:23:32 +0000 (13:23 +0900)
Change-Id: I039ca2e5c538cdd73d12408c0f80c18f36e6533d

tct-suite-vs/Tizen.Telephony.Manual.Tests/testcase/TSChangeNotificationEventArgs.cs [changed mode: 0755->0644]
tct-suite-vs/Tizen.Telephony.Manual.Tests/testcase/TSSlotHandle.cs [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 14f596c..3fbf5fc
@@ -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<IEnumerable<SlotHandle>>(_simList, "simList is Not of IEnumerable<SlotHandle> type");
-            ICollection<SlotHandle> c = _simList as ICollection<SlotHandle>;
-            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<IEnumerable<SlotHandle>>(_simList, "simList is Not of IEnumerable<SlotHandle> type");
+                ICollection<SlotHandle> c = _simList as ICollection<SlotHandle>;
+                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());
old mode 100755 (executable)
new mode 100644 (file)
index e452eb6..8064b30
@@ -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<IEnumerable<SlotHandle>>(_simList, "simList is Not of IEnumerable<SlotHandle> type");
-            ICollection<SlotHandle> c = _simList as ICollection<SlotHandle>;
-            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<IEnumerable<SlotHandle>>(_simList, "simList is Not of IEnumerable<SlotHandle> type");
+                ICollection<SlotHandle> c = _simList as ICollection<SlotHandle>;
+                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());