예제 #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!");
     }
 }