Browse Source

Add Irony_2013_09_03 to .Reporting

reports
Peter Forstmeier 13 years ago
parent
commit
1350fb54a1
  1. 7
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/ICSharpCode.Reporting.csproj
  2. 8
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/ICSharpCode.Reporting.Test.csproj
  3. 70
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/Expressions/IronyGeneral.cs
  4. 18
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/Reportingfactory/PushModelFixture.cs
  5. BIN
      src/AddIns/Misc/Reporting/Irony/Irony_2013_09_03.zip
  6. BIN
      src/AddIns/Misc/Reporting/Libraries/Irony.Interpreter.dll
  7. BIN
      src/AddIns/Misc/Reporting/Libraries/Irony.dll

7
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/ICSharpCode.Reporting.csproj

@ -44,8 +44,11 @@
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="NUnit.Framework"> <Reference Include="Irony">
<HintPath>$(SharpDevelopBinPath)\Tools\NUnit\NUnit.Framework.dll</HintPath> <HintPath>..\Libraries\Irony.dll</HintPath>
</Reference>
<Reference Include="Irony.Interpreter">
<HintPath>..\Libraries\Irony.Interpreter.dll</HintPath>
</Reference> </Reference>
<Reference Include="PresentationCore"> <Reference Include="PresentationCore">
<RequiredTargetFramework>3.0</RequiredTargetFramework> <RequiredTargetFramework>3.0</RequiredTargetFramework>

8
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/ICSharpCode.Reporting.Test.csproj

@ -44,6 +44,12 @@
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Irony">
<HintPath>..\..\..\Libraries\Irony.dll</HintPath>
</Reference>
<Reference Include="Irony.Interpreter">
<HintPath>..\..\..\Libraries\Irony.Interpreter.dll</HintPath>
</Reference>
<Reference Include="nunit.framework"> <Reference Include="nunit.framework">
<HintPath>..\..\..\..\..\..\Tools\NUnit\nunit.framework.dll</HintPath> <HintPath>..\..\..\..\..\..\Tools\NUnit\nunit.framework.dll</HintPath>
</Reference> </Reference>
@ -60,6 +66,7 @@
<ItemGroup> <ItemGroup>
<Compile Include="src\DataSource\ContributorsList.cs" /> <Compile Include="src\DataSource\ContributorsList.cs" />
<Compile Include="src\DataSource\CollectionHandlingFixture.cs" /> <Compile Include="src\DataSource\CollectionHandlingFixture.cs" />
<Compile Include="src\Expressions\IronyGeneral.cs" />
<Compile Include="src\MeasureArrange\ContainerArrangeStrategyFixture.cs" /> <Compile Include="src\MeasureArrange\ContainerArrangeStrategyFixture.cs" />
<Compile Include="src\Model\ReportModelFixture.cs" /> <Compile Include="src\Model\ReportModelFixture.cs" />
<Compile Include="src\Model\ReportSettingsFixture.cs" /> <Compile Include="src\Model\ReportSettingsFixture.cs" />
@ -82,6 +89,7 @@
<Folder Include="src\Model" /> <Folder Include="src\Model" />
<Folder Include="src\DataSource" /> <Folder Include="src\DataSource" />
<Folder Include="src\MeasureArrange" /> <Folder Include="src\MeasureArrange" />
<Folder Include="src\Expressions" />
<Folder Include="src\Reportingfactory" /> <Folder Include="src\Reportingfactory" />
<Folder Include="src\ReportItems" /> <Folder Include="src\ReportItems" />
<Folder Include="src\PageBuilder" /> <Folder Include="src\PageBuilder" />

70
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/Expressions/IronyGeneral.cs

@ -0,0 +1,70 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using Irony.Interpreter.Evaluator;
using NUnit.Framework;
namespace ICSharpCode.Reporting.Test.Expressions
{
[TestFixture]
public class IronyBasics
{
ExpressionEvaluatorGrammar grammar;
ExpressionEvaluator evaluator;
#region Calculation
[Test]
public void CanAddNumber() {
var script = "2 + 3";
var result = evaluator.Evaluate(script);
Assert.That(result,Is.EqualTo(5));
}
#endregion
#region Stringhandling
[Test]
public void CanConcatString() {
var result = evaluator.Evaluate("'SharpDevelop' + ' ' + 'is great'");
Assert.That(result,Is.EqualTo("SharpDevelop is great"));
}
#endregion
#region System.Environment
[Test]
public void CanUserSystemEnvironment() {
//Using methods imported from System.Environment
var script = @"report = '#{MachineName}-#{OSVersion}-#{UserName}'";
var result = evaluator.Evaluate(script);
var expected = string.Format("{0}-{1}-{2}", Environment.MachineName, Environment.OSVersion, Environment.UserName);
Assert.AreEqual(expected, result, "Unexpected computation result");
}
#endregion
#region System.Math
[Test]
public void CanRunSystemMath () {
//Using methods imported from System.Math class
var script = @"abs(-1.0) + Log10(100.0) + sqrt(9) + floor(4.5) + sin(PI/2)";
var result = evaluator.Evaluate(script);
Assert.IsTrue(result is double, "Result is not double.");
Assert.AreEqual(11.0, (double) result, 0.001, "Unexpected computation result");
}
#endregion
[SetUp]
public void Initialize() {
grammar = new ExpressionEvaluatorGrammar();
evaluator = new ExpressionEvaluator(grammar);
}
}
}

18
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/Reportingfactory/PushModelFixture.cs

@ -8,6 +8,7 @@
*/ */
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
@ -93,7 +94,7 @@ namespace ICSharpCode.Reporting.Test.Reportingfactory
[Test] [Test]
public void LastElementInPageIsPageFooter() { public void LastElementInEveryPageIsPageFooter() {
reportCreator.BuildExportList(); reportCreator.BuildExportList();
var firstPage = reportCreator.Pages[1].ExportedItems; var firstPage = reportCreator.Pages[1].ExportedItems;
@ -107,7 +108,7 @@ namespace ICSharpCode.Reporting.Test.Reportingfactory
[Test] [Test]
public void FirstElementOnScoundPageIsReportHeader() { public void FirstElementOnSecondPageIsReportHeader() {
reportCreator.BuildExportList(); reportCreator.BuildExportList();
var exporteditems = reportCreator.Pages[1].ExportedItems; var exporteditems = reportCreator.Pages[1].ExportedItems;
var result = exporteditems[0]; var result = exporteditems[0];
@ -115,6 +116,19 @@ namespace ICSharpCode.Reporting.Test.Reportingfactory
} }
[Test]
public void RowsHasGapOfOne () {
reportCreator.BuildExportList();
var exporteditems = reportCreator.Pages[0].ExportedItems;
for (int i = 1; i < exporteditems.Count -1; i++) {
Console.WriteLine(" {0} - {1} - {2}",exporteditems[i-1].DisplayRectangle.Bottom,exporteditems[i].Location.Y,exporteditems[i].Name);
// Assert.That(exporteditems[i].Location.Y,Is.GreaterThan(exporteditems[i-1].DisplayRectangle.Bottom));
Assert.That(exporteditems[i].Location.Y,Is.EqualTo(exporteditems[i-1].DisplayRectangle.Bottom +1));
}
}
[Test] [Test]
public void DetailContainsOneDataItem() { public void DetailContainsOneDataItem() {
reportCreator.BuildExportList(); reportCreator.BuildExportList();

BIN
src/AddIns/Misc/Reporting/Irony/Irony_2013_09_03.zip

Binary file not shown.

BIN
src/AddIns/Misc/Reporting/Libraries/Irony.Interpreter.dll

Binary file not shown.

BIN
src/AddIns/Misc/Reporting/Libraries/Irony.dll

Binary file not shown.
Loading…
Cancel
Save