diff options
Diffstat (limited to 'src/test/PlayingWithActiveReports.Test/Reports/ReportSectionTest.cs')
| -rw-r--r-- | src/test/PlayingWithActiveReports.Test/Reports/ReportSectionTest.cs | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/test/PlayingWithActiveReports.Test/Reports/ReportSectionTest.cs b/src/test/PlayingWithActiveReports.Test/Reports/ReportSectionTest.cs new file mode 100644 index 0000000..6853b07 --- /dev/null +++ b/src/test/PlayingWithActiveReports.Test/Reports/ReportSectionTest.cs @@ -0,0 +1,45 @@ +using System.Collections.Generic;
+using MbUnit.Framework;
+using PlayingWithActiveReports.Core.Reports;
+
+namespace PlayingWithActiveReports.Test.Reports {
+ [TestFixture]
+ public class ReportSectionTest {
+ [Test]
+ public void Should_Contain_0_Parameters( ) {
+ Assert.AreEqual( 0, CreateSut( ).ParametersCount );
+ }
+
+ [Test]
+ public void Should_Bind_2_Parameters_To_Section( ) {
+ IList< IReportParameter > parameters = new List< IReportParameter >( );
+ parameters.Add( CreateParameter( "QuestionText", "How Old Are You?" ) );
+ parameters.Add( CreateParameter( "AnswerText", "23" ) );
+
+ IReportSection section = CreateSut( );
+ section.BindTo( parameters );
+ Assert.AreEqual( 2, section.ParametersCount );
+ }
+
+ [RowTest]
+ [Row( "Questions" )]
+ [Row( "Results" )]
+ [Row( "Table Of Contents" )]
+ public void Should_Set_Section_Name_To( string name ) {
+ Assert.AreEqual( name, CreateSut( ).WithName( name ).Name );
+ }
+
+ [Test]
+ public void Should_Contain_Undefined_Name( ) {
+ Assert.AreEqual( "Undefined", CreateSut( ).Name );
+ }
+
+ private IReportParameter CreateParameter( string key, string value ) {
+ return new ReportParameter( key, value );
+ }
+
+ private IReportSection CreateSut( ) {
+ return new ReportSection( );
+ }
+ }
+}
\ No newline at end of file |
