Example #1
0
        public void AuthStep2_returns_two_factor_settings()
        {
            // TODO: Test with specifically crafted broken/unsupported responses
            //       The parsing logic is not trivial and it needs in-depth testing.

            var client = SetupPostWithFixture("auth-step2-response");
            var result = Remote.AuthStep2(ClientInfo, "password", "transaction-id", client.Object);

            Assert.That(result.InitialStep, Is.EqualTo(TwoFactorAuth.Step.WaitForOob));
            Assert.That(result.TransactionId, Is.EqualTo("ae830c59-634b-437c-95b6-58158e85ffae"));
            Assert.That(result.Email, Is.EqualTo("*****@*****.**"));
            Assert.That(result.OAuthToken, Is.EqualTo(""));

            Assert.That(result.Devices.Length, Is.EqualTo(1));
            Assert.That(result.Devices[0].Name, Is.EqualTo("LGE Nexus 5"));
            Assert.That(result.Devices[0].Id, Is.StringStarting("MTU5NjAwMjI3MQP04dNsmSNQ2L"));
        }
Example #2
0
 public void AuthStep2_throws_on_common_errors()
 {
     VerifyAllCommonErrorsWithPost(
         http => Remote.AuthStep2(ClientInfo, "password", "transaction-id", http));
 }