[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", "Kamaljeet Chauhan, kamal.jc@samsung.com")]
- public async Task AuthorizeAsync_CHECK_EXCEPTION()
- {
- try
- {
- /*
- * PRECONDITION
- * 1. A valid CodeGrantAuthorizer object
- * 2. Prepare CodeGrantAuthorizationRequest parameters
- */
- var authorizer = new CodeGrantAuthorizer();
- Assert.IsNotNull(authorizer, "Object should not be null after construction");
-
- /* TESTCODE */
- var response = await authorizer.AuthorizeAsync(null);
- Assert.IsTrue(false, "Expected to throw an exception");
-
- /* POSTCONDITION */
- authorizer.Dispose();
- }
- catch (NotSupportedException)
- {
- Assert.IsTrue(isOAuth2Supported == false, "Invalid NotSupportedException");
- }
- catch (Exception ex)
- {
- Assert.IsTrue(true, "Expected to throw an exception");
- }
- }
-
- [Test]
- [Category("P2")]
[Description("Validates the response of GetAccessTokenAsync")]
[Property("SPEC", "Tizen.Account.OAuth2.CodeGrantAuthorizer.GetAccessTokenAsync M")]
[Property("SPEC_URL", "-")]
}
}
- [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", "Kamaljeet Chauhan, kamal.jc@samsung.com")]
- public void ClearCookies_CHECK_EXCEPTION()
- {
- try
- {
- /*
- * PRECONDITION
- * 1. A valid CodeGrantAuthorizer object
- */
- var authorizer = new CodeGrantAuthorizer();
- Assert.IsNotNull(authorizer, "Object should not be null after construction");
-
- /* TESTCODE */
- authorizer.ClearCookies();
- Assert.IsTrue(false, "Expected to throw an exception");
-
- /* POSTCONDITION */
- authorizer.Dispose();
- }
- catch (NotSupportedException)
- {
- Assert.IsTrue(isOAuth2Supported == false, "Invalid NotSupportedException");
- }
- catch (Exception ex)
- {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, ex.ToString());
- Assert.IsTrue(true, "Exception is expected");
- }
- }
-
- [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", "Kamaljeet Chauhan, kamal.jc@samsung.com")]
- public void ClearCache_CHECK_EXCEPTION()
- {
- try
- {
- /*
- * PRECONDITION
- * 1. A valid CodeGrantAuthorizer object
- */
- var authorizer = new CodeGrantAuthorizer();
- Assert.IsNotNull(authorizer, "Object should not be null after construction");
-
- /* TESTCODE */
- authorizer.ClearCache();
- Assert.IsTrue(false, "Expected to throw an exception");
-
- /* POSTCONDITION */
- authorizer.Dispose();
- }
- catch (NotSupportedException)
- {
- Assert.IsTrue(isOAuth2Supported == false, "Invalid NotSupportedException");
- }
- catch (Exception ex)
- {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, ex.ToString());
- Assert.IsTrue(true, "Exception is expected");
- }
- }
}
}
}
}
- [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", "Kamaljeet Chauhan, kamal.jc@samsung.com")]
- public async Task AuthorizeAsync_CHECK_EXCEPTION()
- {
- try
- {
- /*
- * PRECONDITION
- * 1. A valid ImplicitGrantAuthorizer object
- * 2. Prepare ImplicitGrantAuthorizationRequest parameters
- */
- var authorizer = new ImplicitGrantAuthorizer();
- Assert.IsNotNull(authorizer, "Object should not be null after construction");
-
- /* TESTCODE */
- var response = await authorizer.AuthorizeAsync(null);
- Assert.IsTrue(false, "Expected to throw an exception");
-
- /* POSTCONDITION */
- authorizer.Dispose();
- }
- catch (NotSupportedException)
- {
- Assert.IsTrue(isOAuth2Supported == false, "Invalid NotSupportedException");
- }
- catch (Exception ex)
- {
- Assert.IsTrue(true, "Expected to throw an exception");
- }
- }
[Test]
[Category("P2")]