Пример #1
0
        public void DocumentConvertor_CorrectCase_DifferentOutputFolder(string input, string output)
        {
            DocumetConvertorService service = new DocumetConvertorService();

            service.WordToPDFConv(input, output);
            FileAssert.Exists(@"C:\Users\Admin\Desktop\New folder\Test.pdf.pdf");
        }
Пример #2
0
        public void DocumentConvertor_IncorrectCae_OtherException(string input, string output)
        {
            DocumetConvertorService service = new DocumetConvertorService();

            FieldInfo[] fields = typeof(DocumetConvertorService).GetFields(BindingFlags.Instance | BindingFlags.NonPublic);
            FieldInfo   field  = fields.FirstOrDefault(x => x.Name == "isDone");

            field.SetValue(service, false);
            service.WordToPDFConv(input, output);
            Assert.IsFalse((bool)field.GetValue(service));
        }
Пример #3
0
 public static void DocumentToPDFConvert(string inputPath, string outPath)
 {
     try
     {
         DocumetConvertorService document = new DocumetConvertorService();
         document.WordToPDFConv(inputPath, outPath);
     }
     catch (Exception)
     {
         MessageBox.Show("Error during converting. Please check if you selected correct convert file and settings!");
     }
 }