コード例 #1
0
 public void ExecuteCommandRemoveBlobTest()
 {
     AddTestBlobs();
     string containerName = "container20";
     string blobName = "blob0";
     command.Container = containerName;
     command.Blob = blobName;
     RunAsyncCommand(() => command.ExecuteCmdlet());
     string result = (string)MockCmdRunTime.VerboseStream.FirstOrDefault();
     Assert.AreEqual(String.Format(Resources.RemoveBlobSuccessfully, blobName, containerName), result);
     RunAsyncCommand(() => command.ExecuteCmdlet());
     Assert.AreEqual(String.Format(Resources.BlobNotFound, blobName, containerName), 
         MockCmdRunTime.ErrorStream[0].Exception.Message);
 }
コード例 #2
0
        public void ExecuteCommandRemoveBlobTest()
        {
            AddTestBlobs();
            string containerName = "container20";
            string blobName      = "blob0";

            command.Container = containerName;
            command.Blob      = blobName;
            command.ExecuteCmdlet();
            string result = (string)((MockCommandRuntime)command.CommandRuntime).VerboseStream.FirstOrDefault();

            Assert.AreEqual(String.Format(Resources.RemoveBlobSuccessfully, blobName, containerName), result);
            AssertThrows <ResourceNotFoundException>(() => command.ExecuteCmdlet(),
                                                     String.Format(Resources.BlobNotFound, blobName, containerName));
        }