Example #1
0
 public void ExcuteCommandNewContainerTest()
 {
     string name = "containername";
     command.Name = name;
     command.ExecuteCmdlet();
     AzureStorageContainer container = (AzureStorageContainer)((MockCommandRuntime)command.CommandRuntime).OutputPipeline.FirstOrDefault();
     Assert.AreEqual(name, container.Name);
 }
Example #2
0
        public void CreateContainerSuccessfullyTest()
        {
            string name = String.Empty;
            BlobContainerPublicAccessType accesslevel = BlobContainerPublicAccessType.Off;

            MockCmdRunTime.ResetPipelines();
            name         = "test";
            command.Name = name;
            RunAsyncCommand(() => command.ExecuteCmdlet());
            AzureStorageContainer container = (AzureStorageContainer)MockCmdRunTime.OutputPipeline.FirstOrDefault();

            Assert.AreEqual("test", container.Name);

            MockCmdRunTime.ResetPipelines();
            AssertThrowsAsync <ResourceAlreadyExistException>(() => command.CreateAzureContainer(InitTaskId, BlobMock, name, accesslevel),
                                                              String.Format(Resources.ContainerAlreadyExists, name));
        }