Skip to content

Commit

Permalink
Support additional paging scenario
Browse files Browse the repository at this point in the history
Links containing the word 'continue' usually imply a context of the
current page/article, so they're given a higher weight. All current
tests pass; new test added to cover this case.
  • Loading branch information
hempels committed Aug 24, 2012
1 parent 7aa68b2 commit 154a8bc
Show file tree
Hide file tree
Showing 6 changed files with 495 additions and 12 deletions.
11 changes: 10 additions & 1 deletion Src/NReadability/NReadability.Tests/NReadability.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand Down Expand Up @@ -137,6 +137,12 @@
<Content Include="SampleInput\SampleInput_12.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="SampleWebInput\SampleInput_10_3.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="SampleWebInput\SampleInput_10_2.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="SampleWebInput\SampleInput_09_1.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down Expand Up @@ -206,6 +212,9 @@
<Content Include="SampleWebInput\SampleInput_06_2.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="SampleWebInput\SampleInput_10_1.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,22 @@ public class NReadabilityWebTranscoderTests
@"http://www.sparknotes.com/lit/mocking/section2.rhtml",
}
},
{
10,
new[]
{
@"http://www.ilr.cornell.edu/trianglefire/story/introduction.html",
@"http://www.ilr.cornell.edu/trianglefire/story/sweatshopsStrikes.html",
@"http://www.ilr.cornell.edu/trianglefire/story/investigationTrial.html",
}
},
};

#endregion

[Test]
[Sequential]
public void TestSampleInputs([Values(1, 2, 3, 4, 5, 6, 7, 8, 9)]int sampleInputNumber)
public void TestSampleInputs([Values(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)]int sampleInputNumber)
{
const string outputDir = "SampleWebOutput";

Expand Down Expand Up @@ -227,6 +236,18 @@ public void TestSampleInputs([Values(1, 2, 3, 4, 5, 6, 7, 8, 9)]int sampleInputN
Assert.IsTrue(extractedContent.Contains("educational technique but the law."));
break;

case 10:
// page 1
Assert.IsTrue(extractedContent.Contains("he fire at the Triangle Waist Company"));
Assert.IsTrue(extractedContent.Contains("at the hands of industrial greed."));
// page 2
Assert.IsTrue(extractedContent.Contains("he Triangle Waist Company was in many ways"));
Assert.IsTrue(extractedContent.Contains("unsafe working conditions on their employees."));
// page 3 (last)
Assert.IsTrue(extractedContent.Contains("mmediately after the fire, Triangle owners Blanck and Harris"));
Assert.IsTrue(extractedContent.Contains("and that it was \"second to none in the country.\""));
break;

default:
throw new NotSupportedException("Unknown sample input number (" + sampleInputNumber + "). Have you added another sample input? If so, then add appropriate asserts here as well.");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@


<!DOCTYPE html>
<html><!-- InstanceBegin template="/Templates/subPageTemplate.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta charset="UTF-8">

<meta name="Keywords" id="Keywords" content="fire,triangle,strikes,labor,garments,union,commemoration,1911" />

<!-- InstanceBeginEditable name="doctitle" --><title>Cornell University - ILR School - The Triangle Factory Fire - Introduction</title><!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="styles" -->
<link rel="stylesheet" href="../styles/primary.css" />
<link rel="stylesheet" href="../styles/printPrimary.css" type="text/css" media="print" />
<!-- InstanceEndEditable -->
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->

<link rel="image_src" href="http://www.ilr.cornell.edu/trianglefire/images/avatar.jpg"/>
</head>

<body>
<div id="pageWrapper">
<header role="banner">
<!-- InstanceBeginEditable name="banner" -->
<a class="img" href="../index.html"><img src="../images/banner.jpg" alt="Remembering the Triangle Factory Fire, 100 years later" title="Remembering the Triangle Factory Fire, 100 years later" height="100" width="800" /></a>
<!-- InstanceEndEditable -->
</header><!--end banner -->
<div id="navigationContainer">
<nav>

<ul>
<li><a class="active" href="/trianglefire/story/introduction.html">Story of the Fire</a></li>
<li><a href="/trianglefire/victimsWitnesses/victimsList.html">Victims &amp; Witnesses</a></li>
<li><a href="/trianglefire/primary/index.html">Primary Sources</a></li>
<li><a href="/trianglefire/supplemental/index.html">Supplemental Resources</a></li>
<li><a href="/trianglefire/legacy/index.html">Legacy</a></li>
<li><a href="/trianglefire/guestbook/index.html">Guestbook</a></li>
</ul>

</nav> <!--end navigation -->
</div><!--end navigationContainer -->
<div id="pageContent">
<div id="secondaryNavContainer">
<nav>


<ul>
<li><a class="active" href="introduction.html">Introduction</a> :</li>
<li><a href="sweatshopsStrikes.html">Sweatshops &amp; Strikes :</a></li>
<li><a href="fire.html">Fire!</a> :</li>
<li><a href="mourningProtest.html">Mourning &amp; Protest</a> :</li>
<li><a href="reliefWork.html">Relief Work</a> :</li>
<li><a href="investigationTrial.html">Investigation &amp; Trial</a></li>
</ul>

<!-- InstanceBeginEditable name="supplementalPageNav" --><!-- InstanceEndEditable -->

</nav><!--end secondaryNav -->
<div id="search">
<ul>
<li><form action="/trianglefire/search.html"><input type="text" id="searchTerm" name="q" value="Search" onClick="if (this.value == 'Search') this.value=''; return false;" /><input type="submit" name="search" id="searchSubmit" value="" ></form></li>
</ul>
</div>
</div><!--end secondaryNavContainer -->
<section id="mainColumn">
<div id="headingContainer">
<header>
<!-- InstanceBeginEditable name="pageHeading" -->
<h1>INTRODUCTION</h1>
<!-- InstanceEndEditable -->
</header>
</div><!--end headingContainer -->
<article id="mainContent">
<!-- InstanceBeginEditable name="mainContent" -->
<p><span class="initial">T</span>he fire at the Triangle Waist Company in New York City, which claimed the lives of 146 young immigrant workers, is one of the worst disasters since the beginning of the Industrial Revolution.</p>
<p>This incident has had great significance to this day because it highlights the inhumane working conditions to which industrial workers can be subjected. To many, its horrors epitomize the extremes of industrialism.</p>
<p>The tragedy still dwells in the collective memory of the nation and of the international labor movement. The victims of the tragedy are still celebrated as martyrs at the hands of industrial greed.</p>
<!--<p><a href="sweatshopsStrikes.html">Continue <img src="../images/handPointerRust.gif" alt="Hand pointing to link" width="32" height="14" border="0" /></a></p>-->
<p><a href="sweatshopsStrikes.html">Continue &raquo;</a></p>
<!-- InstanceEndEditable -->
</article><!--end mainContent -->
</section><!--end mainColumn -->
<section id="secondaryColumn">
<header>
<!-- InstanceBeginEditable name="secondaryImage" -->
<div id="imageContainer">
<img src="../images/story/storyIntroduction.jpg" alt="Water from fire hoses spraying the top floors of the Asch Building" title="Water from fire hoses spraying the top floors of the Asch Building" height="208" width="280" />
</div><!--end imageContainer -->
<!-- InstanceEndEditable -->

<div class="relatedResources">
<h3><span>R</span>ELATED <span>R</span>ESOURCES</h3>
</div>


<!-- InstanceBeginEditable name="supplementalRelatedResources" --><!-- InstanceEndEditable -->

</header>
<div id="secondaryContent">
<nav>


<!-- InstanceBeginEditable name="supplementalSecondaryContent" -->
<ul>
<li><a href="../victimsWitnesses/victimsList.html">Victims list</a></li>
<li><a href="../supplemental/timeline.html">Timeline</a></li>
<li><a href="../supplemental/3Dmodel.html">9th floor model</a></li>
</ul>
<h4>Documents</h4>
<ul>
<li><a href="../primary/index.html">Original source documents about the Fire</a></li>
</ul>
<!-- InstanceEndEditable -->

</nav>
</div><!--end secondaryContent -->
</section><!--end secondaryColumn -->
<!-- InstanceBeginEditable name="additionalSections" --><!-- InstanceEndEditable -->
</div><!--end pageContent -->
<div id="footerContainer">
<footer>

<ul class="interior">
<li><a href="/trianglefire/contactUs.html">contact</a></li>
<li><a href="/trianglefire/copyrightPermission.html">copyright</a></li>
<li><a href="/trianglefire/supplemental/tipsForStudents.html">tips for students</a></li>
<li><a href="/trianglefire/aboutThisSite.html">about this site</a></li>
</ul><br /><br /> <!-- breaks needed for IE -->
<ul class="exterior">
<li>&copy; 2011</li>
<li><a href="http://www.cornell.edu">Cornell University</a></li>
<li><a href="http://www.ilr.cornell.edu">ILR School</a></li>
<li><a href="http://www.ilr.cornell.edu/library/kheel/">Kheel Center</a></li>
</ul>
</footer><!--end footer -->
</div><!--end footerContainer -->
</div><!--end pageWrapper -->
</body>
<!-- InstanceEnd --></html>
Loading

0 comments on commit 154a8bc

Please sign in to comment.