public void TestDeleteWithContainerNameDefaultFile() { #region AddFile // Arrange using (BlobController controller1 = new BlobController(new BlobBL(new Blob()))) { // Act string filePath = Path.Combine(Path.GetDirectoryName(Path.GetDirectoryName(Directory.GetCurrentDirectory())), "ProfileIcon.png"); using (Stream stream = File.OpenRead(filePath)) { MyTestPostedFileBase file = new MyTestPostedFileBase(stream, "image/png", "ProfileIcon.png"); controller1.FileUpload(file); } } #endregion // Arrange using (BlobController controller = new BlobController(new BlobBL(new Blob()))) { // Act var result = controller.DeleteFile(_defaultContainer); //Assert Assert.IsFalse(result.Data.ToString() == "error", "Exception occur so error."); } }
public void TestFileUpload() { // Arrange using (BlobController controller = new BlobController(new BlobBL(new Blob()))) { // Act string filePath = Path.Combine(Path.GetDirectoryName(Path.GetDirectoryName(Directory.GetCurrentDirectory())), "ProfileIcon.png"); using (Stream stream = File.OpenRead(filePath)) { MyTestPostedFileBase obj = new MyTestPostedFileBase(stream, "image/png", "ProfileIcon.png"); var result = controller.FileUpload(obj, _defaultContainer); //Assert Assert.IsFalse(result.Data.ToString() == "error", "Exception occur so error."); } } }