Пример #1
0
        public void RunCmdletWithoutStorageContext()
        {
            PowerShellAgent.RemoveAzureSubscriptionIfExists();

            CLICommonBVT.SaveAndCleanSubScriptionAndEnvConnectionString();

            string             containerName = Utility.GenNameString("container");
            CloudBlobContainer container     = blobUtil.CreateContainer(containerName);

            try
            {
                bool terminated = false;

                try
                {
                    agent.GetAzureStorageContainer(containerName);
                }
                catch (CmdletInvocationException e)
                {
                    terminated = true;
                    Test.Info(e.Message);
                    Test.Assert(e.Message.StartsWith("Can not find your azure storage credential."), "Can not find your azure storage credential.");
                }
                finally
                {
                    if (!terminated)
                    {
                        Test.AssertFail("without storage context should return a terminating error");
                    }
                }
            }
            finally
            {
                blobUtil.RemoveContainer(containerName);
            }

            CLICommonBVT.RestoreSubScriptionAndEnvConnectionString();
        }
Пример #2
0
 public static void AnonymousBVTClassCleanup()
 {
     FileUtil.CleanDirectory(downloadDirRoot);
     CLICommonBVT.RestoreSubScriptionAndEnvConnectionString();
     TestBase.TestClassCleanup();
 }
Пример #3
0
 public static void InvalidCredentialCasesClassCleanup()
 {
     CLICommonBVT.RestoreSubScriptionAndEnvConnectionString();
     NodeJSAgent.AgentConfig.UseEnvVar = PreviousUseEnvVar;
     TestBase.TestClassCleanup();
 }