Skip to content

Commit

Permalink
Fix #2
Browse files Browse the repository at this point in the history
MangaFox: Test with unlicensed manga. Appveyor CI is US based and cannot access licensed manga in the US. If we test with a licensed manga, this test will failed.
  • Loading branch information
NguyenDanPhuong committed Aug 1, 2016
1 parent e78ef70 commit eb72bf0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
6 changes: 0 additions & 6 deletions MangaRipper.Core/MangaFoxService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,12 @@ public async Task<IList<string>> FindImanges(Chapter chapter, IProgress<int> pro
var parser = new Parser();

// find all pages in a chapter
Trace.WriteLine("FindImanges > DownloadStringAsync: " + chapter.Link);
string input = await downloader.DownloadStringAsync(chapter.Link);
Trace.WriteLine("FindImanges > Input Length: " + input.Length);
var newInput = input.Substring(13000, 3000);
Trace.WriteLine(newInput);
var pages = parser.Parse(@"<option value=""(?<Value>[^""]+)"" (|selected=""selected"")>\d+</option>", input, "Value");
Trace.WriteLine("FindImanges > Before Count: " + pages.Count);
// transform pages link
pages = pages.Select(p =>
{
var value = new Uri(new Uri(chapter.Link), (p + ".html")).AbsoluteUri;
Trace.WriteLine("FindImanges > Transform: " + p + " " + value);
return value;
}).ToList();

Expand Down
11 changes: 6 additions & 5 deletions MangaRipper.Test/UnitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void Initialize()
}

[TestMethod]
public async Task TestMangaReader_Test()
public async Task MangaReader_Test()
{
string url = "http://www.mangareader.net/naruto";
var service = Framework.GetService(url);
Expand All @@ -35,18 +35,19 @@ public async Task TestMangaReader_Test()
[TestMethod]
public async Task MangaFox_Test()
{
string url = "http://mangafox.me/manga/poputepipikku";
// Test with unlicensed manga. Appveyor CI is US based and cannot access licensed manga in the US.
// If we test with a licensed manga, this test will failed.
string url = "http://mangafox.me/manga/tian_jiang_xian_shu_nan/";
var service = Framework.GetService(url);
var chapters = await service.FindChapters(url, new Progress<int>(), source.Token);
Assert.IsTrue(chapters.Count > 0, "Cannot find chapters.");
var chapter = chapters[0];
Trace.WriteLine(string.Format("MangaFox_Test - Chapter: [{0}] [{1}]", chapter.Name, chapter.Link));
var images = await service.FindImanges(chapter, new Progress<int>(), source.Token);
Assert.IsTrue(images.Count > 0, "Cannot find images.");
}

[TestMethod]
public async Task TestMangaHere_Test()
public async Task MangaHere_Test()
{
string url = "http://www.mangahere.co/manga/the_god_of_high_school/";
var service = Framework.GetService(url);
Expand All @@ -58,7 +59,7 @@ public async Task TestMangaHere_Test()
}

[TestMethod]
public async Task TestMangaShare_Test()
public async Task MangaShare_Test()
{
string url = "http://read.mangashare.com/Beelzebub";
var service = Framework.GetService(url);
Expand Down

0 comments on commit eb72bf0

Please sign in to comment.