2013-12-02 02:24:14 +00:00
|
|
|
|
using MediaBrowser.Controller.Providers;
|
2013-10-29 00:35:01 +00:00
|
|
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Tests.Providers {
|
|
|
|
|
[TestClass]
|
|
|
|
|
public class MovieDbProviderTests {
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public void TestNameMatches() {
|
|
|
|
|
var name = string.Empty;
|
|
|
|
|
int? year = null;
|
2014-07-05 05:21:13 +00:00
|
|
|
|
|
2013-12-02 02:24:14 +00:00
|
|
|
|
NameParser.ParseName("My Movie (2013)", out name, out year);
|
2013-10-29 00:35:01 +00:00
|
|
|
|
Assert.AreEqual("My Movie", name);
|
|
|
|
|
Assert.AreEqual(2013, year);
|
2014-07-05 05:21:13 +00:00
|
|
|
|
|
2013-10-29 00:35:01 +00:00
|
|
|
|
name = string.Empty;
|
|
|
|
|
year = null;
|
2013-12-02 02:24:14 +00:00
|
|
|
|
NameParser.ParseName("My Movie 2 (2013)", out name, out year);
|
2013-10-29 00:35:01 +00:00
|
|
|
|
Assert.AreEqual("My Movie 2", name);
|
|
|
|
|
Assert.AreEqual(2013, year);
|
2014-07-05 05:21:13 +00:00
|
|
|
|
|
2013-10-29 00:35:01 +00:00
|
|
|
|
name = string.Empty;
|
|
|
|
|
year = null;
|
2013-12-02 02:24:14 +00:00
|
|
|
|
NameParser.ParseName("My Movie 2001 (2013)", out name, out year);
|
2013-10-29 00:35:01 +00:00
|
|
|
|
Assert.AreEqual("My Movie 2001", name);
|
|
|
|
|
Assert.AreEqual(2013, year);
|
2014-07-05 05:21:13 +00:00
|
|
|
|
|
2013-10-29 00:35:01 +00:00
|
|
|
|
name = string.Empty;
|
|
|
|
|
year = null;
|
2013-12-02 02:24:14 +00:00
|
|
|
|
NameParser.ParseName("My Movie - 2 (2013)", out name, out year);
|
2013-10-29 00:35:01 +00:00
|
|
|
|
Assert.AreEqual("My Movie - 2", name);
|
|
|
|
|
Assert.AreEqual(2013, year);
|
2014-07-05 05:21:13 +00:00
|
|
|
|
|
2013-10-29 00:35:01 +00:00
|
|
|
|
name = string.Empty;
|
|
|
|
|
year = null;
|
2013-12-02 02:24:14 +00:00
|
|
|
|
NameParser.ParseName("curse.of.chucky.2013.stv.unrated.multi.1080p.bluray.x264-rough", out name, out year);
|
2013-10-29 00:35:01 +00:00
|
|
|
|
Assert.AreEqual("curse.of.chucky", name);
|
|
|
|
|
Assert.AreEqual(2013, year);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|