Ejemplo n.º 1
0
        public virtual void TestWithCustomString()
        {
            PathIOException pe = new PathIOException(path, error);

            Assert.Equal(new Path(path), pe.GetPath());
            Assert.Equal("`" + path + "': " + error, pe.Message);
        }
Ejemplo n.º 2
0
        public virtual void TestWithDefaultString()
        {
            PathIOException pe = new PathIOException(path);

            Assert.Equal(new Path(path), pe.GetPath());
            Assert.Equal("`" + path + "': Input/output error", pe.Message);
        }
Ejemplo n.º 3
0
        public virtual void TestWithThrowable()
        {
            IOException     ioe = new IOException("KABOOM");
            PathIOException pe  = new PathIOException(path, ioe);

            Assert.Equal(new Path(path), pe.GetPath());
            Assert.Equal("`" + path + "': Input/output error: " + error, pe
                         .Message);
        }
Ejemplo n.º 4
0
 /// <summary>Build an exception from any other Path IO Exception.</summary>
 /// <remarks>
 /// Build an exception from any other Path IO Exception.
 /// This propagates the path of the original exception
 /// </remarks>
 /// <param name="message">more specific text</param>
 /// <param name="cause">cause</param>
 public RegistryIOException(string message, PathIOException cause)
     : base(cause.GetPath() != null ? cause.GetPath().ToString() : string.Empty, message
            , cause)
 {
 }