summaryrefslogtreecommitdiff
path: root/src/app/PlayingWithActiveReports.Core/Task
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/app/PlayingWithActiveReports.Core/Task
import from svntrunkmain
Diffstat (limited to 'src/app/PlayingWithActiveReports.Core/Task')
-rw-r--r--src/app/PlayingWithActiveReports.Core/Task/IResultSectionTask.cs8
-rw-r--r--src/app/PlayingWithActiveReports.Core/Task/IResultsReportTask.cs7
-rw-r--r--src/app/PlayingWithActiveReports.Core/Task/StubResultsReportTask.cs28
3 files changed, 43 insertions, 0 deletions
diff --git a/src/app/PlayingWithActiveReports.Core/Task/IResultSectionTask.cs b/src/app/PlayingWithActiveReports.Core/Task/IResultSectionTask.cs
new file mode 100644
index 0000000..7b18c53
--- /dev/null
+++ b/src/app/PlayingWithActiveReports.Core/Task/IResultSectionTask.cs
@@ -0,0 +1,8 @@
+using System.Collections.Generic;
+using PlayingWithActiveReports.Core.Dto;
+
+namespace PlayingWithActiveReports.Test.Reports {
+ public interface IResultSectionTask {
+ IEnumerable< DisplayReportQuestionDto > GetResults( );
+ }
+} \ No newline at end of file
diff --git a/src/app/PlayingWithActiveReports.Core/Task/IResultsReportTask.cs b/src/app/PlayingWithActiveReports.Core/Task/IResultsReportTask.cs
new file mode 100644
index 0000000..3367e6f
--- /dev/null
+++ b/src/app/PlayingWithActiveReports.Core/Task/IResultsReportTask.cs
@@ -0,0 +1,7 @@
+using PlayingWithActiveReports.Core.Reports;
+
+namespace PlayingWithActiveReports.Core.Task {
+ public interface IResultsReportTask {
+ IResultsReport CreateReport( );
+ }
+} \ No newline at end of file
diff --git a/src/app/PlayingWithActiveReports.Core/Task/StubResultsReportTask.cs b/src/app/PlayingWithActiveReports.Core/Task/StubResultsReportTask.cs
new file mode 100644
index 0000000..d6ba5cf
--- /dev/null
+++ b/src/app/PlayingWithActiveReports.Core/Task/StubResultsReportTask.cs
@@ -0,0 +1,28 @@
+using System.Collections.Generic;
+using PlayingWithActiveReports.Core.Domain;
+using PlayingWithActiveReports.Core.Reports;
+using PlayingWithActiveReports.Core.Repositories;
+
+namespace PlayingWithActiveReports.Core.Task {
+ public class StubResultsReportTask : IResultsReportTask {
+ public StubResultsReportTask( ) : this( new QuestionBank( ) ) {}
+
+ public StubResultsReportTask( IQuestionBank bank ) {
+ _bank = bank;
+ }
+
+ public IResultsReport CreateReport( ) {
+ _bank.CreateQuestion( "What is your name?" ).ChangeAnswerTo( "mO" );
+ _bank.CreateQuestion( "How old are you?" ).ChangeAnswerTo( "23" );
+ return new ResultsReport( ).BindTo( CreateParameters( ) ).Execute( );
+ }
+
+ private IEnumerable< IReportParameter > CreateParameters( ) {
+ return new List< IQuestion >( _bank.FindAll( ) ).ConvertAll< IReportParameter >(
+ delegate( IQuestion input ) { return new ReportParameter( input.Text, input.CurrentAnswer.Text ); }
+ );
+ }
+
+ private IQuestionBank _bank;
+ }
+} \ No newline at end of file