[Non-ACR][OAuth2][auto][New Test Cases added for CodeGrantAuthorize and ImplicitGrant... 91/202491/4
authorkamaljeet <kamal.jc@samsung.com>
Fri, 29 Mar 2019 07:01:46 +0000 (12:31 +0530)
committerkamaljeet <kamal.jc@samsung.com>
Fri, 29 Mar 2019 10:00:13 +0000 (15:30 +0530)
Change-Id: I2e8aeb8d2a872b089894fa48ff9431554ed47cf3
Signed-off-by: kamaljeet <kamal.jc@samsung.com>
tct-suite-vs/Tizen.OAuth2.Tests/testcase/TSCodeGrantAuthorizer.cs
tct-suite-vs/Tizen.OAuth2.Tests/testcase/TSImplicitGrantAuthorizer.cs

index b84ff5c..8d78682 100755 (executable)
@@ -63,13 +63,13 @@ namespace Tizen.Account.OAuth2.Tests
             }
         }
 
-        //[Test]
+        [Test]
         [Category("P2")]
         [Description("Validates the response of AuthorizeAsync")]
         [Property("SPEC", "Tizen.Account.OAuth2.CodeGrantAuthorizer.AuthorizeAsync M")]
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MEX")]
-        [Property("AUTHOR", "Jyothi Kumar Sambolu, s.jyothi@samsung.com")]
+        [Property("AUTHOR", "Kamaljeet Chauhan, kamal.jc@samsung.com")]
         public async Task AuthorizeAsync_CHECK_EXCEPTION()
         {
             try
@@ -82,11 +82,8 @@ namespace Tizen.Account.OAuth2.Tests
                 var authorizer = new CodeGrantAuthorizer();
                 Assert.IsNotNull(authorizer, "Object should not be null after construction");
 
-                var request = OAuth2Helper.CreateCodeGrantAuthRequest(true);
-                Assert.IsNotNull(request, "Object should not be null after construction");
-
                 /* TESTCODE */
-                var response = await authorizer.AuthorizeAsync(request);
+                var response = await authorizer.AuthorizeAsync(null);
                 Assert.IsTrue(false, "Expected to throw an exception");
 
                 /* POSTCONDITION */
@@ -98,7 +95,7 @@ namespace Tizen.Account.OAuth2.Tests
             }
             catch (Exception ex)
             {
-                Assert.IsTrue(ex is OAuth2Exception, "Wrong exception thrown.Expected is OAuth2Exception");
+                Assert.IsTrue(true, "Expected to throw an exception");
             }
         }
 
@@ -141,14 +138,14 @@ namespace Tizen.Account.OAuth2.Tests
             }
         }
 
-        //[Test]
-        [Category("P1")]
-        [Description("Checks the invocation of ClearCookies")]
+        [Test]
+        [Category("P2")]
+        [Description("Validates the response of ClearCookies")]
         [Property("SPEC", "Tizen.Account.OAuth2.CodeGrantAuthorizer.ClearCookies M")]
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MR")]
-        [Property("AUTHOR", "Jyothi Kumar Sambolu, s.jyothi@samsung.com")]
-        public void ClearCookies_CHECK_NO_EXCEPTION()
+        [Property("AUTHOR", "Kamaljeet Chauhan, kamal.jc@samsung.com")]
+        public void ClearCookies_CHECK_EXCEPTION()
         {
             try
             {
@@ -161,7 +158,7 @@ namespace Tizen.Account.OAuth2.Tests
 
                 /* TESTCODE */
                 authorizer.ClearCookies();
-                Assert.IsTrue(true, "Not Expected to throw an exception");
+                Assert.IsTrue(false, "Expected to throw an exception");
 
                 /* POSTCONDITION */
                 authorizer.Dispose();
@@ -173,18 +170,18 @@ namespace Tizen.Account.OAuth2.Tests
             catch (Exception ex)
             {
                 LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, ex.ToString());
-                Assert.IsTrue(false, "Exception is not expected");
+                Assert.IsTrue(true, "Exception is expected");
             }
         }
 
-        //[Test]
-        [Category("P1")]
-        [Description("Checks the invocation of ClearCache")]
+        [Test]
+        [Category("P2")]
+        [Description("Validates the response of ClearCache")]
         [Property("SPEC", "Tizen.Account.OAuth2.CodeGrantAuthorizer.ClearCache M")]
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MR")]
-        [Property("AUTHOR", "Jyothi Kumar Sambolu, s.jyothi@samsung.com")]
-        public void ClearCache_CHECK_NO_EXCEPTION()
+        [Property("AUTHOR", "Kamaljeet Chauhan, kamal.jc@samsung.com")]
+        public void ClearCache_CHECK_EXCEPTION()
         {
             try
             {
@@ -197,7 +194,7 @@ namespace Tizen.Account.OAuth2.Tests
 
                 /* TESTCODE */
                 authorizer.ClearCache();
-                Assert.IsTrue(true, "Not Expected to throw an exception");
+                Assert.IsTrue(false, "Expected to throw an exception");
 
                 /* POSTCONDITION */
                 authorizer.Dispose();
@@ -209,7 +206,7 @@ namespace Tizen.Account.OAuth2.Tests
             catch (Exception ex)
             {
                 LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, ex.ToString());
-                Assert.IsTrue(false, "Exception is not expected");
+                Assert.IsTrue(true, "Exception is expected");
             }
         }
     }
index 4499c7c..f8be299 100755 (executable)
@@ -63,14 +63,14 @@ namespace Tizen.Account.OAuth2.Tests
             }
         }
 
-        //[Test]
+        [Test]
         [Category("P2")]
         [Description("Validates the response of AuthorizeAsync")]
         [Property("SPEC", "Tizen.Account.OAuth2.ImplicitGrantAuthorizer.AuthorizeAsync M")]
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MEX")]
-        [Property("AUTHOR", "Jyothi Kumar Sambolu, s.jyothi@samsung.com")]
-        public async Task AuthorizeAsync_EXCEPTION()
+        [Property("AUTHOR", "Kamaljeet Chauhan, kamal.jc@samsung.com")]
+        public async Task AuthorizeAsync_CHECK_EXCEPTION()
         {
             try
             {
@@ -82,11 +82,8 @@ namespace Tizen.Account.OAuth2.Tests
                 var authorizer = new ImplicitGrantAuthorizer();
                 Assert.IsNotNull(authorizer, "Object should not be null after construction");
 
-                var request = OAuth2Helper.CreateImplicitGrantAuthRequest(true);
-                Assert.IsNotNull(request, "Object should not be null after construction");
-
                 /* TESTCODE */
-                var response = await authorizer.AuthorizeAsync(request);
+                var response = await authorizer.AuthorizeAsync(null);
                 Assert.IsTrue(false, "Expected to throw an exception");
 
                 /* POSTCONDITION */
@@ -98,7 +95,7 @@ namespace Tizen.Account.OAuth2.Tests
             }
             catch (Exception ex)
             {
-                Assert.IsTrue(ex is OAuth2Exception, "Wrong exception thrown.Expected is OAuth2Exception");
+                Assert.IsTrue(true, "Expected to throw an exception");
             }
         }