/// <summary> /// Button click, Delete WorkItems by Ids from a File. /// </summary> private void DeleteFileButton_Click(object sender, EventArgs e) { string deleteFile = SelctedFileTextBox.Text; if (String.IsNullOrEmpty(deleteFile)) { Alert.AlertCreation("Browse a File!", AlertType.error); return; } else { CustomMessageBox messageBox = new CustomMessageBox("Are you sure that you would like to Delete form the Server by Selected File?"); messageBox.ShowDialog(); if (messageBox.returnValue == true) { if (UploadActiveButton.Text.Equals("Active")) { Alert.AlertCreation("Yes", AlertType.info); bool result = informationParser.DeleteFromFile_Process(deleteFile, serverOperator, mailSender); if (result) { for (int i = 0; i <= 100; ++i) { FileDeleteProgressBar.Value = i; FileDeleteProgressBar.Update(); } Alert.AlertCreation("Delete From File Success!", AlertType.success); } else { Alert.AlertCreation("Delete From File Failed!", AlertType.error); FileDeleteProgressBar.Value = 0; return; } FileDeleteProgressBar.Value = 0; SelctedFileTextBox.Visible = false; } else { Alert.AlertCreation("Inactive Server Connection", AlertType.error); SelctedFileTextBox.Clear(); return; } } else { Alert.AlertCreation("No", AlertType.info); } } }
public void DeleteFromFile_Process_IntegrationTest_NoFileFail() { // Arrange InformationParser informationParser = new InformationParser(); Logger logger = new Logger("DeleteFromFile_Process_IntegrationTest2.log"); ServerOperationManager operationManager = informationParser.Init_ServerOperation(logger); // Act string workingDirectory = Environment.CurrentDirectory; string projectDirectory = Directory.GetParent(workingDirectory).Parent.FullName; string fileName = ""; string path = Path.Combine(projectDirectory, @"TestFiles\", fileName); bool result = informationParser.DeleteFromFile_Process(path, operationManager, informationParser.Init_MailSender(logger)); // Assert Assert.IsFalse(result); }