/// <summary> /// Calls amazon upload handler and updates status if success. /// </summary> /// <param name="handler">AmazonHandler instance.</param> /// <param name="cur">Current item in queue.</param> private void amazonHelper(AmazonHandler amazonHandler, StorageResult cur) { bool succeeded = amazonHandler.putObject(cur.LocalFileName, cur.AWSFileName, this.bucketName); if (succeeded) { cur.Status = Status.UPLOADED; storage.UpdateStatus(Int32.Parse(cur.UploadID), Status.UPLOADED); } }
public void StatusTestFalse() { String filePath = Directory.GetCurrentDirectory().ToString(); filePath = Directory.GetParent(filePath).ToString(); filePath = Directory.GetParent(filePath).ToString(); filePath += @"\UnitTest1.cs"; String objectName = "UnitTests/UnitTest1.cs"; String bucketName = "broadcastlogger-audio"; AmazonHandler amazonHandler = new AmazonHandler(); amazonHandler.putObject(filePath, objectName, "asdf"); Assert.AreEqual(amazonHandler.Status, false); }
public void putObjectTest() { String filePath = Directory.GetCurrentDirectory().ToString(); filePath = Directory.GetParent(filePath).ToString(); filePath = Directory.GetParent(filePath).ToString(); filePath += @"\UnitTest1.cs"; String objectName = "UnitTests/UnitTest1.cs"; String bucketName = "broadcastlogger-audio"; AmazonHandler amazonHandler = new AmazonHandler(); bool result = amazonHandler.putObject(filePath, objectName, bucketName); Assert.AreEqual(result, true); }