Example #1
0
 public void WindowsAPICodePackWrapperFolder()
 {
     try
     {
         // Used to cancel after .2 seconds
         UnitTestWinFormHelper.RunTaskTimeout(
             token => Task.Run(
                 () => { WindowsAPICodePackWrapper.Folder(FileSystemUtils.ExecutableDirectoryName(), "Test"); }, token));
     }
     catch (COMException)
     {
     }
     catch (TimeoutException)
     {
     }
     catch (Exception ex)
     {
         Assert.Fail(
             $"Wrong exception got {ex.GetType().Name} expected OperationCanceledException : {ex.ExceptionMessages()}");
     }
 }
Example #2
0
 public void APICodePackWrapperSave()
 {
     try
     {
         UnitTestWinFormHelper.RunTaskTimeout(token => Task.Run(() =>
                                                                WindowsAPICodePackWrapper.Save(FileSystemUtils.ExecutableDirectoryName(), "Test", null, null), token));
     }
     catch (COMException)
     {
     }
     catch (TimeoutException)
     {
     }
     catch (OperationCanceledException)
     {
     }
     catch (Exception ex)
     {
         Assert.Fail(
             $"Wrong exception got {ex.GetType().Name} expected OperationCanceledException : {ex.ExceptionMessages()}");
     }
 }