mirror of
https://github.com/Sonarr/Sonarr
synced 2024-12-24 16:53:54 +00:00
OsAgnostic Paths
This commit is contained in:
parent
8d54bb64a7
commit
5b25f9c799
1 changed files with 11 additions and 3 deletions
|
@ -11,22 +11,30 @@ namespace NzbDrone.Common.Test.DiskProviderTests
|
|||
[TestFixture]
|
||||
public class IsParentFixture : TestBase<DiskProvider>
|
||||
{
|
||||
private string _parent = @"C:\Test".AsOsAgnostic();
|
||||
|
||||
[Test]
|
||||
public void should_return_false_when_not_a_child()
|
||||
{
|
||||
Subject.IsParent(@"C:\Test", @"C:\Another Folder").Should().BeFalse();
|
||||
var path = @"C:\Another Folder".AsOsAgnostic();
|
||||
|
||||
Subject.IsParent(_parent, path).Should().BeFalse();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_true_when_folder_is_parent_of_another_folder()
|
||||
{
|
||||
Subject.IsParent(@"C:\Test", @"C:\Test\TV").Should().BeTrue();
|
||||
var path = @"C:\Test\TV".AsOsAgnostic();
|
||||
|
||||
Subject.IsParent(_parent, path).Should().BeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_true_when_folder_is_parent_of_a_file()
|
||||
{
|
||||
Subject.IsParent(@"C:\Test", @"C:\Test\30.Rock.S01E01.Pilot.avi").Should().BeTrue();
|
||||
var path = @"C:\Test\30.Rock.S01E01.Pilot.avi".AsOsAgnostic();
|
||||
|
||||
Subject.IsParent(_parent, path).Should().BeTrue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue