public void ConvertFilesTest() { IFCConversionService iFCConversionService = new IFCConversionService(); string input = "E://downloads//Source"; string target = "E://downloads//res"; Assert.IsTrue(iFCConversionService.ConvertFiles(input, target, DestinationLocationType.Local).Result == IFCConvertStatus.Done); input = "E://downloads//123"; Assert.IsTrue(iFCConversionService.ConvertFiles(input, target, DestinationLocationType.Local).Result == IFCConvertStatus.Error); input = "E://downloads//res"; Assert.IsTrue(iFCConversionService.ConvertFiles(input, target, DestinationLocationType.Local).Result == IFCConvertStatus.NoFiles); }
private async void ConvertFiles() { var validationResult = await Validate(); if (!validationResult) { return; } var status = await iFCConversionService.ConvertFiles(SourcePath, DestinationPath, DestinationType); if (status == IFCConvertStatus.NoFiles) { _ = await IDialogCoordinator.ShowMessageAsync(this, "Error", "The source folder does not contain IFC files. Please reselect and try again"); return; } else if (status == IFCConvertStatus.Done) { if (DestinationType == DestinationLocationType.Both) { _ = await IDialogCoordinator.ShowMessageAsync(this, "Success", "All the IFC files have been converted and uploaded successfully"); return; } else { _ = await IDialogCoordinator.ShowMessageAsync(this, "Success", "All the IFC files have been converted successfully"); return; } } }