1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/NzbDrone.Common.Test/DiskProviderTests/IsParentFixture.cs

37 lines
982 B
C#
Raw Normal View History

2013-09-17 09:14:47 +03:00
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Test.Common;
namespace NzbDrone.Common.Test.DiskProviderTests
{
[TestFixture]
2013-09-17 09:14:47 +03:00
public class IsParentFixture : TestBase<DiskProvider>
{
2013-09-17 09:14:47 +03:00
private string _parent = @"C:\Test".AsOsAgnostic();
[Test]
2013-09-17 09:14:47 +03:00
public void should_return_false_when_not_a_child()
{
2013-09-17 09:14:47 +03:00
var path = @"C:\Another Folder".AsOsAgnostic();
2013-08-12 07:57:10 +03:00
2013-09-17 09:14:47 +03:00
Subject.IsParent(_parent, path).Should().BeFalse();
}
[Test]
2013-09-17 09:14:47 +03:00
public void should_return_true_when_folder_is_parent_of_another_folder()
{
2013-09-17 09:14:47 +03:00
var path = @"C:\Test\TV".AsOsAgnostic();
2013-08-12 07:57:10 +03:00
2013-09-17 09:14:47 +03:00
Subject.IsParent(_parent, path).Should().BeTrue();
}
[Test]
2013-09-17 09:14:47 +03:00
public void should_return_true_when_folder_is_parent_of_a_file()
{
2013-09-17 09:14:47 +03:00
var path = @"C:\Test\30.Rock.S01E01.Pilot.avi".AsOsAgnostic();
Subject.IsParent(_parent, path).Should().BeTrue();
}
}
}