Example #1
0
        public void AuthCheck_returns_oauth_token()
        {
            var client = SetupPostWithFixture("auth-check-success-response");
            var result = Remote.AuthCheck(ClientInfo, "transaction-id", client.Object);

            Assert.That(result, Is.StringStarting("eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI"));
        }
Example #2
0
        public void AuthCheck_throws_on_pending()
        {
            var client = SetupPostWithFixture("auth-check-pending-response");

            Assert.That(() => Remote.AuthCheck(ClientInfo, "transaction-id", client.Object),
                        Throws.TypeOf <FetchException>()
                        .And.Property("Reason")
                        .EqualTo(FetchException.FailureReason.RespondedWithError));
        }
Example #3
0
 public void AuthCheck_throws_on_common_errors()
 {
     VerifyAllCommonErrorsWithPost(
         http => Remote.AuthCheck(ClientInfo, "transaction-id", http));
 }