Exemplo n.º 1
0
        public async Task ReadCredentialWorksForSingleCredential()
        {
            // Given we have saved the credential
            await TestUtils.RunAndVerify <bool>(
                test : (requestContext) => service.HandleSaveCredentialRequest(new Credential(CredentialId, Password1), requestContext),
                verify : (actual => Assert.True(actual, "Expect Credential to be saved successfully")));


            // Expect read of the credential to return the password
            await TestUtils.RunAndVerify <Credential>(
                test : (requestContext) => service.HandleReadCredentialRequest(new Credential(CredentialId, null), requestContext),
                verify : (actual =>
            {
                Assert.Equal(Password1, actual.Password);
            }));
        }