diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2011-10-17 15:30:28 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2011-10-17 15:30:28 +0400 |
commit | 1da923eaf0f4f62e150c5b725407f91af749029c (patch) | |
tree | 605bb400abd511a4b3432d9489b972ff03dbb7fb /main/tests | |
parent | 02caef6247d4ecbe6aaa253eed0e39f027bd7417 (diff) |
[UnitTests] Added tests for the new AbsoluteToRelativePath
implementation.
I can remember that I wrote those cases 10 years ago for #develop ...
that method didn't change for quite a long time ^^. (But string.Split
is way too costly for this operation.)
Diffstat (limited to 'main/tests')
-rw-r--r-- | main/tests/UnitTests/MonoDevelop.Projects/FileServiceTests.cs | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/main/tests/UnitTests/MonoDevelop.Projects/FileServiceTests.cs b/main/tests/UnitTests/MonoDevelop.Projects/FileServiceTests.cs new file mode 100644 index 0000000000..507bb2fd2f --- /dev/null +++ b/main/tests/UnitTests/MonoDevelop.Projects/FileServiceTests.cs @@ -0,0 +1,45 @@ +// +// FileServiceTests.cs +// +// Author: +// Mike Krüger <mkrueger@xamarin.com> +// +// Copyright (c) 2011 Xamarin Inc. (http://xamarin.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; +using MonoDevelop.Core; +using NUnit.Framework; +using UnitTests; + +namespace MonoDevelop.Projects +{ + [TestFixture] + public class FileServiceTests : TestBase + { + [Test] + public void TestGetRelativePath () + { + Assert.AreEqual (@"blub", FileService.AbsoluteToRelativePath (@"/a", @"/a/blub")); + Assert.AreEqual (@"../a/blub", FileService.AbsoluteToRelativePath (@"/hello/", @"/a/blub")); + Assert.AreEqual (@"../a/blub", FileService.AbsoluteToRelativePath (@"/hello", @"/a/blub")); + } + } +} + |