[Non-ACR][NFC][Add Exception case in NFC auto/manual TC] 63/211463/5
authorJung Jihoon <jh8801.jung@samsung.com>
Tue, 6 Aug 2019 02:34:17 +0000 (11:34 +0900)
committerJung Jihoon <jh8801.jung@samsung.com>
Wed, 7 Aug 2019 07:19:35 +0000 (16:19 +0900)
- It is known issue in NFC Native TC.
- Becuase of the "Access Control" method in MCD feature,
  the opearations return "Security Restricted" Error.
- but It is normal operation in MCD, so we add to the new pass condition.

Change-Id: I9fa850ebd8ace13d1ac975e4634dbef15aa435e5
Signed-off-by: Jung Jihoon <jh8801.jung@samsung.com>
tct-suite-vs/Tizen.Nfc.Tests/testcase/TSNfcCardEmulationAdapter.cs
tct-suite-vs/Tizen.Nfc.Tests/testcase/TSNfcManager.cs

index 906a323..fc4af1f 100755 (executable)
@@ -104,6 +104,10 @@ namespace Tizen.Network.Nfc.Tests
             {
                 Assert.IsTrue(isNfcSupported == false || isCeSupported == false, "Method throw the NotSupportedException, but Tizen support the Nfc opearation");
             }
+            catch (InvalidOperationException e)
+            {
+                Assert.IsTrue(e.Message.Equals("SecurityRestrictedError"), "It is normal operation because the application should have the platform certification");
+            }
         }
 
         [Test]
@@ -129,6 +133,10 @@ namespace Tizen.Network.Nfc.Tests
             {
                 Assert.IsTrue(isNfcSupported == false || isCeSupported == false, "Method throw the NotSupportedException, but Tizen support the Nfc opearation");
             }
+            catch (InvalidOperationException e)
+            {
+                Assert.IsTrue(e.Message.Equals("SecurityRestrictedError"), "It is normal operation because the application should have the platform certification");
+            }
         }\r
 \r
         [Test]\r
@@ -192,6 +200,10 @@ namespace Tizen.Network.Nfc.Tests
             {
                 Assert.IsTrue(isNfcSupported == false || isCeSupported == false, "Method throw the NotSupportedException, but Tizen support the Nfc opearation");
             }
+            catch (InvalidOperationException e)
+            {
+                Assert.IsTrue(e.Message.Equals("SecurityRestrictedError"), "It is normal operation because the application should have the platform certification");
+            }
         }
 
         [Test]
@@ -380,12 +392,12 @@ namespace Tizen.Network.Nfc.Tests
 
         [Test]
         [Category("P2")]
-        [Description("Register Aid with null value on AID param, and check Null Reference Exception.")]
+        [Description("Register Aid with null value on AID param, and check occur Argument Exception.")]
         [Property("SPEC", "Tizen.Network.Nfc.NfcCardEmulationAdapter.RegisterAid M")]
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MEX")]
         [Property("AUTHOR", "Jihoon Jung, jh8801.jung@samsung.com")]
-        public void RegisterAid_CHECK_NULL_REFERENCE_EXCEPTION()
+        public void RegisterAid_CHECK_ARGUEMENT_EXCEPTION()
         {
             /*
             * TEST CODE
@@ -398,26 +410,26 @@ namespace Tizen.Network.Nfc.Tests
                 /* TEST CODE */
                 ceAdapter.RegisterAid(NfcSecureElementType.Hce, NfcCardEmulationCategoryType.Other, aid);
 
-                Assert.Fail( "RegisterAid method should be make the Null Reference Exception");
+                Assert.Fail( "RegisterAid method should be make the Argument Exception");
             }
             catch (NotSupportedException)
             {
                 Assert.IsTrue(isNfcSupported == false || isHceSupported == false, "Method throw the NotSupportedException, but Tizen support the Nfc opearation");
             }\r
-            catch (Exception ex)\r
+            catch (ArgumentException ex)\r
             {\r
-                Assert.True(true, "Null Reference Exception occurs. Msg : " + ex.ToString());\r
+                Assert.True(true, "Argument Exception occurs. Msg : " + ex.ToString());\r
             }
         }
 
         [Test]
         [Category("P2")]
-        [Description("Unregister Aid with null value on AID param, and check Null Reference Exception.")]
+        [Description("Unregister Aid with null value on AID param, and check occur Argument Exception.")]
         [Property("SPEC", "Tizen.Network.Nfc.NfcCardEmulationAdapter.UnregisterAid M")]
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MEX")]
         [Property("AUTHOR", "Jihoon Jung, jh8801.jung@samsung.com")]
-        public void UnregisterAid_CHECK_NULL_REFERENCE_EXCEPTION()
+        public void UnregisterAid_CHECK_ARGUMENT_EXCEPTION()
         {
             /*
             * TEST CODE
@@ -430,15 +442,15 @@ namespace Tizen.Network.Nfc.Tests
                 /* TEST CODE */
                 ceAdapter.UnregisterAid(NfcSecureElementType.Hce, NfcCardEmulationCategoryType.Other, aid);
 
-                Assert.Fail( "UnregisterAid method should be make the Null Reference Exception");
+                Assert.Fail( "UnregisterAid method should be make the Argument Exception");
             }
             catch (NotSupportedException)
             {
                 Assert.IsTrue(isNfcSupported == false || isHceSupported == false, "Method throw the NotSupportedException, but Tizen support the Nfc opearation");
             }\r
-            catch (Exception ex)\r
+            catch (ArgumentException ex)\r
             {\r
-                Assert.True(true, "Null Reference Exception occurs. Msg : " + ex.ToString());\r
+                Assert.True(true, "Argument Exception occurs. Msg : " + ex.ToString());\r
             }
         }
 
@@ -583,12 +595,12 @@ namespace Tizen.Network.Nfc.Tests
 
         [Test]
         [Category("P2")]
-        [Description("Call GetRegisteredAidInformation method with null value on AID param, and check Null Reference Exception.")]
+        [Description("Call GetRegisteredAidInformation method with null value on AID param, and check Argument Exception.")]
         [Property("SPEC", "Tizen.Network.Nfc.NfcCardEmulationAdapter.GetRegisteredAidInformation M")]
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MEX")]
         [Property("AUTHOR", "Jihoon Jung, jh8801.jung@samsung.com")]
-        public void ForeachRegisteredAidInformations_CHECK_EXCEPTION()
+        public void ForeachRegisteredAidInformations_CHECK_ARGUMENT_EXCEPTION()
         {
             /*
             * TEST CODE
@@ -599,15 +611,15 @@ namespace Tizen.Network.Nfc.Tests
 
                 /* TEST CODE */
                 ceAdapter.GetRegisteredAidInformation(0, 0);
-                Assert.Fail("ForeachRegisteredAidInformations method should be make the exception");
+                Assert.Fail("ForeachRegisteredAidInformations method should be make the argument exception");
             }
             catch (NotSupportedException)
             {
                 Assert.IsTrue(isNfcSupported == false || isHceSupported == false, "Method throw the NotSupportedException, but Tizen support the Nfc opearation");
             }\r
-            catch (Exception ex)\r
+            catch (ArgumentException ex)\r
             {\r
-                Assert.True(true, "Null Reference Exception occurs. Msg : " + ex.ToString());\r
+                Assert.True(true, "Argument Exception occurs. Msg : " + ex.ToString());\r
             }
         }
     }
index e087aaa..a5a439b 100755 (executable)
@@ -114,6 +114,15 @@ namespace Tizen.Network.Nfc.Tests
             try
             {
                 /* TEST CODE */
+                NfcCardEmulationAdapter ceAdapter = NfcManager.GetCardEmulationAdapter();
+
+                if (ceAdapter.GetCardEmulationMode() == NfcSecureElementCardEmulationMode.On)
+                {
+                    ceAdapter.DisableCardEmulation();
+                }
+
+                ceAdapter.EnableCardEmulation();
+
                 Array s_SETypeEnums = Enum.GetValues(typeof(NfcSecureElementType));
                 NfcSecureElementType seType1 = NfcManager.SecureElementType;
 
@@ -128,6 +137,10 @@ namespace Tizen.Network.Nfc.Tests
             {
                 Assert.IsTrue(isNfcSupported == false || isCeSupported == false, "Test code throw the NotSupportedException, but Tizen support the Nfc Ce operation");
             }
+            catch (InvalidOperationException e)
+            {
+                Assert.IsTrue(e.Message.Equals("SecurityRestrictedError"), "It is normal operation because the application should have the platform certification");
+            }
         }
 
         [Test]