protected override List <string> PerformExecution(Dictionary <string, string> evaluatedValues) { try { var dropboxResult = DropboxSingleExecutor.ExecuteTask(_dropboxClientWrapper); if (IsUplodValidSuccess) { //FileSuccesResult = GlobalConstants.DropBoxSucces; FileMetadata = ((DropboxUploadSuccessResult)dropboxResult).GerFileMetadata(); } else { Exception = ((DropboxFailureResult)dropboxResult).GetException(); } return(new List <string> { string.Empty }); } catch (Exception e) { //dataObject.Environment.AddError(e.Message); Dev2Logger.Error(e.Message, e); //FileSuccesResult = GlobalConstants.DropBoxFailure; Exception = new DropboxFailureResult(new Exception()).GetException(); return(new List <string> { string.Empty }); } }
protected override List <string> PerformExecution(Dictionary <string, string> evaluatedValues) { try { var dropboxResult = GetDropboxSingleExecutor(It.IsAny <IDropboxSingleExecutor <IDropboxResult> >()).ExecuteTask(TestConstant.DropboxClientInstance.Value); if (IsUplodValidSuccess) { Response = ((DropboxDownloadSuccessResult)dropboxResult).GetDownloadResponse(); } else { Exception = ((DropboxFailureResult)dropboxResult).GetException(); } return(new List <string> { string.Empty }); } catch (Exception e) { Dev2Logger.Error(e.Message, e, GlobalConstants.WarewolfError); Exception = new DropboxFailureResult(new Exception()).GetException(); return(new List <string> { string.Empty }); } }
public void ConstructDropBoxFailureResult_GivenException_ShouldRetunNewFailureResult() { //---------------Set up test pack------------------- var failureResult = new DropboxFailureResult(new Exception("Message")); //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- //---------------Test Result ----------------------- Assert.IsNotNull(failureResult); }
public void failureResult_GivenException_ShouldRetunNewFailureResult() { //---------------Set up test pack------------------- var dpExc = new Exception("Message"); var failureResult = new DropboxFailureResult(dpExc); //---------------Assert Precondition---------------- Assert.IsNotNull(failureResult); //---------------Execute Test ---------------------- var exception = failureResult.GetException(); //---------------Test Result ----------------------- Assert.AreEqual(exception, dpExc); }
protected override List <string> PerformExecution(Dictionary <string, string> evaluatedValues) { try { var dropboxResult = DropboxSingleExecutor.ExecuteTask(_dropboxClient); if (!IsUplodValidSuccess) { Exception = ((DropboxFailureResult)dropboxResult).GetException(); } return(new List <string> { string.Empty }); } catch (Exception e) { Dev2Logger.Error(e.Message, e, GlobalConstants.WarewolfError); Exception = new DropboxFailureResult(new Exception()).GetException(); return(new List <string> { string.Empty }); } }