summaryrefslogtreecommitdiff
path: root/src/test/PlayingWithActiveReports.Test/Reports/ReportSectionTest.cs
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2007-11-02 17:03:42 -0600
committermo khan <mo@mokhan.ca>2007-11-02 17:03:42 -0600
commit36ffa9f174c831146ca5630a41b75c9d213f3db6 (patch)
tree3ba71964656b385995bb9557c87a05b131348ddf /src/test/PlayingWithActiveReports.Test/Reports/ReportSectionTest.cs
import from svntrunkmain
Diffstat (limited to 'src/test/PlayingWithActiveReports.Test/Reports/ReportSectionTest.cs')
-rw-r--r--src/test/PlayingWithActiveReports.Test/Reports/ReportSectionTest.cs45
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