\r
public string Directory\r
{\r
- get;\r
- set;\r
+ get\r
+ {\r
+ if (directory != null)\r
+ {\r
+ return directory;\r
+ }\r
+ return "";\r
+ }\r
+ set\r
+ {\r
+ throw new NotImplementedException();\r
+ }\r
}\r
\r
public FilePath Parent\r
using System.Collections.Generic;\r
using System.Text;\r
using System.Diagnostics;\r
+using System.Reflection;\r
+using System.Text.RegularExpressions;\r
using Karinto;\r
using NUnit.Framework;\r
\r
Assert.AreEqual(".test", path.Extension);\r
FilePath.WorkDirectory = System.IO.Path.GetTempPath();\r
}\r
+\r
+ [Test]\r
+ public void AbsolutePath()\r
+ {\r
+ string exePath = Assembly.GetExecutingAssembly().Location;\r
+ FilePath path = new FilePath(exePath);\r
+ Assert.AreEqual("KarintoTest", path.BaseName);\r
+ Assert.AreEqual(".dll", path.Extension);\r
+ Assert.IsNotNull(path.Directory);\r
+ Assert.IsTrue(Regex.Match(path.Directory,@"[/\\]KarintoTest[/\\]bin[/\]").Success);\r
+ }\r
}\r
}\r