public void TestIgnoreBracketsForMovieMatch() { string name = "Rocky [The awesome movie]"; string match; string[] possibles; MovieDbProvider.FindId(name, null, out match, out possibles); Assert.IsNotNull(match); }
public void TestSpecificMovieMatch() { string name = "Flight of the Phoenix (2004)"; string match; string[] possibles; MovieDbProvider.FindId(name, null, out match, out possibles); Assert.IsNotNull(match); }
public void TestSpecificMovieMatchFails() { string name = "Flight of the Phoenix"; string match; string[] possibles; var id = MovieDbProvider.FindId(name, 1977, out match, out possibles); Assert.IsNull(match); Assert.IsNull(id); }
public void TestFetching() { int count = 0; int matched = 0; List <string> nonmatches = new List <string>(); using (StreamReader sr = File.OpenText(@"..\..\..\TestMediaBrowser\movies.txt")) { string line = sr.ReadLine(); while (line != null) { string match; string name = Helper.RemoveCommentsFromName(Path.GetFileName(line)); string[] possibles; string id = MovieDbProvider.FindId(name, out match, out possibles); count++; if (match == null) { nonmatches.Add(name); Debug.WriteLine(name + " not matched"); if (possibles != null) { Debug.WriteLine("\t" + string.Join("\n\t", possibles)); } else { Debug.WriteLine("\tNo possible matches"); } } else { matched++; Debug.WriteLine(name + " matched with " + match); Debug.WriteLine(string.Format("http://api.themoviedb.org/2.0/Movie.getInfo?id={0}&api_key={1}", id, "f6bd687ffa63cd282b6ff2c6877f2669")); } line = sr.ReadLine(); } } Debug.WriteLine(string.Format("Fetching matched {0}/{1}", matched, count)); Debug.WriteLine("The following were not matched: "); Debug.WriteLine(string.Join("\n", nonmatches.ToArray())); }
public void TestSpecificMovieMatch() { string name = "Flight of the Phoenix (2004)"; string match; string[] possibles; MovieDbProvider.FindId(name, out match, out possibles); if (match == null) { Debug.WriteLine(name + " not matched"); if (possibles != null) { Debug.WriteLine("\t" + string.Join("\n\t", possibles)); } else { Debug.WriteLine("\tNo possible matches"); } } else { Debug.WriteLine(name + " matched with " + match); } }