You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Sonarr/NzbDrone.Common.Test/DiskProviderTests/IsParentFixture.cs

37 lines
982 B

11 years ago
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Test.Common;
namespace NzbDrone.Common.Test.DiskProviderTests
{
[TestFixture]
11 years ago
public class IsParentFixture : TestBase<DiskProvider>
{
11 years ago
private string _parent = @"C:\Test".AsOsAgnostic();
[Test]
11 years ago
public void should_return_false_when_not_a_child()
{
11 years ago
var path = @"C:\Another Folder".AsOsAgnostic();
11 years ago
11 years ago
Subject.IsParent(_parent, path).Should().BeFalse();
}
[Test]
11 years ago
public void should_return_true_when_folder_is_parent_of_another_folder()
{
11 years ago
var path = @"C:\Test\TV".AsOsAgnostic();
11 years ago
11 years ago
Subject.IsParent(_parent, path).Should().BeTrue();
}
[Test]
11 years ago
public void should_return_true_when_folder_is_parent_of_a_file()
{
11 years ago
var path = @"C:\Test\30.Rock.S01E01.Pilot.avi".AsOsAgnostic();
Subject.IsParent(_parent, path).Should().BeTrue();
}
}
}