public static async Task CleanupCredential(
     TestConnectionResult connectionResult,
     CredentialInfo credential)
 {
     var service = new SecurityService();
     await SecurityTestUtils.DeleteCredential(service, connectionResult, credential);
 }
        public static async Task <CredentialInfo> SetupCredential(TestConnectionResult connectionResult)
        {
            var service    = new SecurityService();
            var credential = SecurityTestUtils.GetTestCredentialInfo();
            await SecurityTestUtils.DeleteCredential(service, connectionResult, credential);

            await SecurityTestUtils.CreateCredential(service, connectionResult, credential);

            return(credential);
        }
        public async Task TestHandleDeleteCredentialRequest()
        {
            using (SelfCleaningTempFile queryTempFile = new SelfCleaningTempFile())
            {
                // setup
                var connectionResult = await LiveConnectionHelper.InitLiveConnectionInfoAsync("master", queryTempFile.FilePath);

                var service    = new SecurityService();
                var credential = SecurityTestUtils.GetTestCredentialInfo();
                await SecurityTestUtils.DeleteCredential(service, connectionResult, credential);

                await SecurityTestUtils.CreateCredential(service, connectionResult, credential);

                // test
                await SecurityTestUtils.DeleteCredential(service, connectionResult, credential);
            }
        }