File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ public class HtmlReportBuilderTests
1717 [ MethodImpl ( MethodImplOptions . NoInlining ) ]
1818 public void ShouldProduceExpectedHtml ( )
1919 {
20+ string expected = GetReportHtml ( ) ;
2021 var model = new HtmlReportViewModel (
2122 new DefaultHtmlReportConfiguration ( ) ,
2223 new ReportTestData ( ) . CreateTwoStoriesEachWithTwoScenariosWithThreeStepsOfFiveMilliseconds ( ) ) ;
@@ -25,7 +26,26 @@ public void ShouldProduceExpectedHtml()
2526
2627 var result = sut . CreateReport ( model ) ;
2728
28- Approvals . Verify ( result ) ;
29+ //Approvals.Verify(result);
30+ Assert . That ( result , Is . EqualTo ( expected ) ) ;
2931 }
32+
33+ private string GetReportHtml ( )
34+ {
35+ var assembly = Assembly . GetExecutingAssembly ( ) ;
36+ var resourceName = "TestStack.BDDfy.Tests.Reporters.Html.HtmlReportBuilderTests.ShouldProduceExpectedHtml.approved.txt" ;
37+
38+ string result ;
39+ using ( Stream stream = assembly . GetManifestResourceStream ( resourceName ) )
40+ {
41+ using ( StreamReader reader = new StreamReader ( stream ) )
42+ {
43+ result = reader . ReadToEnd ( ) ;
44+ }
45+ }
46+
47+ return result ;
48+ }
49+
3050 }
3151}
Original file line number Diff line number Diff line change 147147 <ItemGroup >
148148 <None Include =" packages.config" />
149149 </ItemGroup >
150+ <ItemGroup >
151+ <EmbeddedResource Include =" Reporters\Html\HtmlReportBuilderTests.ShouldProduceExpectedHtml.approved.txt" />
152+ </ItemGroup >
150153 <Import Project =" $(MSBuildToolsPath)\Microsoft.CSharp.targets" />
151154 <Import Project =" $(SolutionDir)\.nuget\NuGet.targets" Condition =" Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
152155 <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
You can’t perform that action at this time.
0 commit comments