public async Task DownloadFile_BlobNotFoundExeption() { string actualExceptionMessage = ""; string expectedExceptionMessage = "The specified blob does not exist."; sourceContainerReference = Guid.NewGuid().ToString(); await blobStorageTools.CreateContainerAsync(sourceContainerReference); try { await blobStorageTools.DownloadAsync(sourceContainerReference, "fake", "fake"); } catch (Exception ex) { actualExceptionMessage = ex.Message; } Assert.AreEqual(expectedExceptionMessage, actualExceptionMessage); }
public async Task <ActionResult <IEnumerable <string> > > Get() { BlobStorageTools tools = new BlobStorageTools(azureProvider); string err = ""; try { await tools.MoveAsync("blah", "blah", "blah", "blah"); } catch (Exception ex) { System.Console.WriteLine(ex); err += ex.Message; } try { await tools.UploadAsync("sample-de542a93-8a61-4ba6-b2e5-ed3e76f0c56c", @"./test1.txt"); } catch (Exception ex) { System.Console.WriteLine(ex); err += ex.Message; } try { await tools.DownloadAsync("sample-de542a93-8a61-4ba6-b2e5-ed3e76f0c56c", "test1.txt", "./copy-test1.txt"); } catch (Exception ex) { System.Console.WriteLine(ex); err += ex.Message; } if (err == "") { return(Ok()); } return(BadRequest(err)); }