2013-06-12 21:46:50 +00:00
|
|
|
|
using MediaBrowser.Controller.Resolvers;
|
|
|
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Tests.Resolvers
|
|
|
|
|
{
|
|
|
|
|
[TestClass]
|
|
|
|
|
public class MovieResolverTests
|
|
|
|
|
{
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public void TestMultiPartFiles()
|
|
|
|
|
{
|
2014-03-15 22:52:43 +00:00
|
|
|
|
Assert.IsFalse(EntityResolutionHelper.IsMultiPartFile(@"Braveheart.mkv"));
|
|
|
|
|
Assert.IsFalse(EntityResolutionHelper.IsMultiPartFile(@"Braveheart - 480p.mkv"));
|
|
|
|
|
Assert.IsFalse(EntityResolutionHelper.IsMultiPartFile(@"Braveheart - 720p.mkv"));
|
|
|
|
|
|
2013-06-12 21:46:50 +00:00
|
|
|
|
Assert.IsFalse(EntityResolutionHelper.IsMultiPartFile(@"blah blah.mkv"));
|
|
|
|
|
|
|
|
|
|
Assert.IsTrue(EntityResolutionHelper.IsMultiPartFile(@"blah blah - cd1.mkv"));
|
|
|
|
|
Assert.IsTrue(EntityResolutionHelper.IsMultiPartFile(@"blah blah - disc1.mkv"));
|
|
|
|
|
Assert.IsTrue(EntityResolutionHelper.IsMultiPartFile(@"blah blah - disk1.mkv"));
|
|
|
|
|
Assert.IsTrue(EntityResolutionHelper.IsMultiPartFile(@"blah blah - pt1.mkv"));
|
|
|
|
|
Assert.IsTrue(EntityResolutionHelper.IsMultiPartFile(@"blah blah - part1.mkv"));
|
|
|
|
|
Assert.IsTrue(EntityResolutionHelper.IsMultiPartFile(@"blah blah - dvd1.mkv"));
|
|
|
|
|
|
|
|
|
|
// Add a space
|
|
|
|
|
Assert.IsTrue(EntityResolutionHelper.IsMultiPartFile(@"blah blah - cd 1.mkv"));
|
|
|
|
|
Assert.IsTrue(EntityResolutionHelper.IsMultiPartFile(@"blah blah - disc 1.mkv"));
|
|
|
|
|
Assert.IsTrue(EntityResolutionHelper.IsMultiPartFile(@"blah blah - disk 1.mkv"));
|
|
|
|
|
Assert.IsTrue(EntityResolutionHelper.IsMultiPartFile(@"blah blah - pt 1.mkv"));
|
|
|
|
|
Assert.IsTrue(EntityResolutionHelper.IsMultiPartFile(@"blah blah - part 1.mkv"));
|
|
|
|
|
Assert.IsTrue(EntityResolutionHelper.IsMultiPartFile(@"blah blah - dvd 1.mkv"));
|
2013-06-16 19:02:57 +00:00
|
|
|
|
|
|
|
|
|
// Not case sensitive
|
|
|
|
|
Assert.IsTrue(EntityResolutionHelper.IsMultiPartFile(@"blah blah - Disc1.mkv"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public void TestMultiPartFolders()
|
|
|
|
|
{
|
2014-03-15 22:52:43 +00:00
|
|
|
|
Assert.IsFalse(EntityResolutionHelper.IsMultiPartFolder(@"blah blah"));
|
2013-06-16 19:02:57 +00:00
|
|
|
|
|
2014-03-15 22:52:43 +00:00
|
|
|
|
Assert.IsTrue(EntityResolutionHelper.IsMultiPartFolder(@"blah blah - cd1"));
|
|
|
|
|
Assert.IsTrue(EntityResolutionHelper.IsMultiPartFolder(@"blah blah - disc1"));
|
|
|
|
|
Assert.IsTrue(EntityResolutionHelper.IsMultiPartFolder(@"blah blah - disk1"));
|
|
|
|
|
Assert.IsTrue(EntityResolutionHelper.IsMultiPartFolder(@"blah blah - pt1"));
|
|
|
|
|
Assert.IsTrue(EntityResolutionHelper.IsMultiPartFolder(@"blah blah - part1"));
|
|
|
|
|
Assert.IsTrue(EntityResolutionHelper.IsMultiPartFolder(@"blah blah - dvd1"));
|
2013-06-16 19:02:57 +00:00
|
|
|
|
|
|
|
|
|
// Add a space
|
2014-03-15 22:52:43 +00:00
|
|
|
|
Assert.IsTrue(EntityResolutionHelper.IsMultiPartFolder(@"blah blah - cd 1"));
|
|
|
|
|
Assert.IsTrue(EntityResolutionHelper.IsMultiPartFolder(@"blah blah - disc 1"));
|
|
|
|
|
Assert.IsTrue(EntityResolutionHelper.IsMultiPartFolder(@"blah blah - disk 1"));
|
|
|
|
|
Assert.IsTrue(EntityResolutionHelper.IsMultiPartFolder(@"blah blah - pt 1"));
|
|
|
|
|
Assert.IsTrue(EntityResolutionHelper.IsMultiPartFolder(@"blah blah - part 1"));
|
|
|
|
|
Assert.IsTrue(EntityResolutionHelper.IsMultiPartFolder(@"blah blah - dvd 1"));
|
2013-06-16 19:02:57 +00:00
|
|
|
|
|
|
|
|
|
// Not case sensitive
|
2014-03-15 22:52:43 +00:00
|
|
|
|
Assert.IsTrue(EntityResolutionHelper.IsMultiPartFolder(@"blah blah - Disc1"));
|
2013-06-12 21:46:50 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|