diff options
author | Joel Martinez <joelmartinez@gmail.com> | 2018-10-09 00:11:48 +0300 |
---|---|---|
committer | Joel Martinez <joelmartinez@gmail.com> | 2018-10-09 00:11:48 +0300 |
commit | e2cff76aa6c9ab74d606dc4ad5327b306b2e5807 (patch) | |
tree | 1069cf1d36b9517060597176f6c8af87ca3a2531 /mdoc/mdoc.Test/FrameworkIndexHelperTests.cs | |
parent | 8cf10bda931e8d4e726eb673b362c6e0214336fa (diff) |
Added some tests for framework name parsing
Diffstat (limited to 'mdoc/mdoc.Test/FrameworkIndexHelperTests.cs')
-rw-r--r-- | mdoc/mdoc.Test/FrameworkIndexHelperTests.cs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/mdoc/mdoc.Test/FrameworkIndexHelperTests.cs b/mdoc/mdoc.Test/FrameworkIndexHelperTests.cs index 0f435772..540a7e05 100644 --- a/mdoc/mdoc.Test/FrameworkIndexHelperTests.cs +++ b/mdoc/mdoc.Test/FrameworkIndexHelperTests.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Linq; using Mono.Documentation.Framework; +using Mono.Documentation.Updater.Frameworks; using NUnit.Framework; namespace mdoc.Test @@ -30,5 +31,35 @@ namespace mdoc.Test Assert.AreEqual(1, frameworkIndex["Namespace2"].Types.Count); Assert.AreEqual("Type2", frameworkIndex["Namespace2"].Types.Single(i => i.Id == "T:Type2").Name); } + + + + [Test] + public void Test_Frameworks_Path () + { + var fxpath = "/some/path/with/frameworks.xml"; + var assemblyPath = "/some/path/with/fxname/thing.dll"; + var fxname = FrameworkIndex.GetFrameworkNameFromPath (fxpath, assemblyPath); + + Assert.AreEqual ("fxname", fxname); + } + + public void Test_Frameworks_Path_NoXml () + { + var fxpath = "/some/path/with"; + var assemblyPath = "/some/path/with/fxname/thing.dll"; + var fxname = FrameworkIndex.GetFrameworkNameFromPath (fxpath, assemblyPath); + + Assert.AreEqual ("fxname", fxname); + } + + public void Test_Frameworks_Path_MismatchedSlashes () + { + var fxpath = "/some\\path/with"; + var assemblyPath = "/some/path/with\\fxname/thing.dll"; + var fxname = FrameworkIndex.GetFrameworkNameFromPath (fxpath, assemblyPath); + + Assert.AreEqual ("fxname", fxname); + } } }
\ No newline at end of file |