Author: dpsenner
Date: Fri Nov 13 20:46:20 2015
New Revision: 1714265

URL: http://svn.apache.org/viewvc?rev=1714265&view=rev
Log:
LOG4NET-488: fix tests for .net 2.0

This is a modified version of the patch supplied by NN.

Modified:
    logging/log4net/trunk/tests/src/Appender/SmtpPickupDirAppenderTest.cs

Modified: logging/log4net/trunk/tests/src/Appender/SmtpPickupDirAppenderTest.cs
URL: 
http://svn.apache.org/viewvc/logging/log4net/trunk/tests/src/Appender/SmtpPickupDirAppenderTest.cs?rev=1714265&r1=1714264&r2=1714265&view=diff
==============================================================================
--- logging/log4net/trunk/tests/src/Appender/SmtpPickupDirAppenderTest.cs 
(original)
+++ logging/log4net/trunk/tests/src/Appender/SmtpPickupDirAppenderTest.cs Fri 
Nov 13 20:46:20 2015
@@ -220,8 +220,7 @@ namespace log4net.Tests.Appender
                        Assert.AreEqual(1, 
Directory.GetFiles(_testPickupDir).Length);
                        var fileInfo = new 
FileInfo(Directory.GetFiles(_testPickupDir)[0]);
                        Assert.AreEqual("." + fileExtension, 
fileInfo.Extension);
-                       Guid tmpGuid;
-                       Assert.IsTrue(Guid.TryParse(fileInfo.Name.Substring(0, 
fileInfo.Name.Length - fileInfo.Extension.Length), out tmpGuid)); // Assert 
that filename before extension is a guid
+                       Assert.DoesNotThrow(delegate { new 
Guid(fileInfo.Name.Substring(0, fileInfo.Name.Length - 
fileInfo.Extension.Length)); }); // Assert that filename before extension is a 
guid
 
                        Assert.AreEqual("", sh.Message, "Unexpected error 
message");
                }
@@ -242,8 +241,7 @@ namespace log4net.Tests.Appender
                        Assert.AreEqual(1, 
Directory.GetFiles(_testPickupDir).Length);
                        var fileInfo = new 
FileInfo(Directory.GetFiles(_testPickupDir)[0]);
                        Assert.IsEmpty(fileInfo.Extension);
-                       Guid tmpGuid;
-                       Assert.IsTrue(Guid.TryParse(fileInfo.Name, out 
tmpGuid)); // Assert that filename is a guid
+                       Assert.DoesNotThrow(delegate { new Guid(fileInfo.Name); 
}); // Assert that filename is a guid
 
                        Assert.AreEqual("", sh.Message, "Unexpected error 
message");
                }


Reply via email to