summaryrefslogtreecommitdiff
path: root/src/test/PlayingWithActiveReports.Test/Reports/ResultsSectionTest.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/PlayingWithActiveReports.Test/Reports/ResultsSectionTest.cs')
-rw-r--r--src/test/PlayingWithActiveReports.Test/Reports/ResultsSectionTest.cs34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/test/PlayingWithActiveReports.Test/Reports/ResultsSectionTest.cs b/src/test/PlayingWithActiveReports.Test/Reports/ResultsSectionTest.cs
new file mode 100644
index 0000000..bb185d4
--- /dev/null
+++ b/src/test/PlayingWithActiveReports.Test/Reports/ResultsSectionTest.cs
@@ -0,0 +1,34 @@
+using System.Collections.Generic;
+using MbUnit.Framework;
+using PlayingWithActiveReports.Core.Dto;
+using PlayingWithActiveReports.Core.Reports;
+
+namespace PlayingWithActiveReports.Test.Reports {
+ [TestFixture]
+ public class ResultsSectionTest {
+ [Test]
+ public void Should_Be_Able_To_Bind_Dtos_To_Report( ) {
+ IResultsSection section = CreateSut( );
+ IList< DisplayReportQuestionDto > results = new List< DisplayReportQuestionDto >( );
+ results.Add( CreateDto( "How are you?", "good" ) );
+ results.Add( CreateDto( "How are you?", "bad" ) );
+ results.Add( CreateDto( "How are you?", "hungry" ) );
+
+ section.BindTo( results );
+ Assert.AreEqual( 3, section.ResultsCount );
+ }
+
+ [Test]
+ public void Should_Have_No_Results( ) {
+ Assert.AreEqual( 0, CreateSut( ).ResultsCount );
+ }
+
+ private DisplayReportQuestionDto CreateDto( string question, string answer ) {
+ return new DisplayReportQuestionDto( question, answer );
+ }
+
+ private IResultsSection CreateSut( ) {
+ return new ResultsSection( );
+ }
+ }
+} \ No newline at end of file