├── .gitignore ├── Concordion.NUnit ├── Addin │ ├── ConcordionTest.cs │ ├── ConcordionTestFixture.cs │ └── SuiteBuilderAddin.cs ├── Concordion.NUnit.csproj └── Properties │ └── AssemblyInfo.cs ├── Concordion.Runners ├── Concordion.Runners.csproj ├── NUnit │ ├── ExecutableSpecification.cs │ └── ExecutableSpecification.html └── Properties │ └── AssemblyInfo.cs ├── Concordion.Spec ├── Concordion.Spec.config ├── Concordion.Spec.csproj ├── Concordion │ ├── Attributes │ │ ├── AttributesTest.cs │ │ ├── ConcordionTestAttributeTest.cs │ │ ├── ExampleIgnoreTest.cs │ │ └── IgnoreAttributeTest.cs │ ├── Command │ │ ├── AssertEquals │ │ │ ├── AssertEqualsTest.cs │ │ │ ├── CaseSensitiveTest.cs │ │ │ ├── ExceptionsTest.cs │ │ │ ├── NestedActionsTest.cs │ │ │ ├── NestedHtmlElementsTest.cs │ │ │ ├── NonString │ │ │ │ ├── BooleanTest.cs │ │ │ │ ├── NonStringTest.cs │ │ │ │ ├── NullResultTest.cs │ │ │ │ └── VoidResultTest.cs │ │ │ ├── SupportedElementsTest.cs │ │ │ └── Whitespace │ │ │ │ ├── LineContinuationsTest.cs │ │ │ │ ├── NormalizationTest.cs │ │ │ │ └── WhitespaceTest.cs │ │ ├── AssertFalse │ │ │ └── AssertFalseTest.cs │ │ ├── AssertTrue │ │ │ └── AssertTrueTest.cs │ │ ├── CaseInsensitiveCommandsTest.cs │ │ ├── CommandTest.cs │ │ ├── Echo │ │ │ ├── DisplayingNullsTest.cs │ │ │ ├── EchoTest.cs │ │ │ └── EscapingHtmlCharactersTest.cs │ │ ├── EvaluatingCommandsTest.cs │ │ ├── Execute │ │ │ ├── AccessToLinkHrefTest.cs │ │ │ ├── ExecuteTest.cs │ │ │ ├── ExecutingListTest.cs │ │ │ └── ExecutingTablesTest.cs │ │ ├── Results │ │ │ └── Stylesheet │ │ │ │ ├── MissingHeadElementTest.cs │ │ │ │ └── StylesheetTest.cs │ │ ├── Run │ │ │ ├── RunTest.cs │ │ │ └── RunTestRunner.cs │ │ ├── Set │ │ │ └── SetTest.cs │ │ └── VerifyRows │ │ │ ├── Results │ │ │ ├── MissingRowsTest.cs │ │ │ └── SurplusRowsTest.cs │ │ │ ├── TableBodySupportTest.cs │ │ │ ├── VerifyRowsTest.cs │ │ │ └── VerifyRowsXHTMLNamespaceTest.cs │ ├── ConcordionTest.cs │ ├── Configuration │ │ ├── BaseInputDirectory.html │ │ ├── BaseInputDirectoryTest.cs │ │ └── SpecificationSuffixXhtmlTest.cs │ ├── ExampleTest.cs │ ├── Extension │ │ ├── AbstractExtensionTestCase.cs │ │ ├── Command │ │ │ ├── CommandExtension.cs │ │ │ ├── CustomCommandTest.cs │ │ │ └── LogCommand.cs │ │ ├── Configuration │ │ │ ├── ExampleDerivedFixtureWithClassAttributes.cs │ │ │ ├── ExampleDerivedFixtureWithFieldAttributes.cs │ │ │ ├── ExampleFixtureBaseWithClassAttribute.cs │ │ │ ├── ExampleFixtureBaseWithFieldAttributes.cs │ │ │ ├── ExampleFixtureWithClassAttributes.cs │ │ │ ├── ExampleFixtureWithCombinedConfiguration.cs │ │ │ ├── ExampleFixtureWithFieldAttributes.cs │ │ │ ├── ExampleFixtureWithoutExtensions.cs │ │ │ ├── ExtensionConfigurationTest.cs │ │ │ ├── FakeExtension1.cs │ │ │ ├── FakeExtension2.cs │ │ │ ├── FakeExtension2Factory.cs │ │ │ ├── FakeExtension3.cs │ │ │ └── FakeExtensionBase.cs │ │ ├── Css │ │ │ ├── CssEmbeddedExtension.cs │ │ │ ├── CssExtensionTest.cs │ │ │ └── CssLinkedExtension.cs │ │ ├── ExtensionTest.cs │ │ ├── FileSuffix │ │ │ ├── FileSuffixExtensionsTest.cs │ │ │ └── XhtmlExtension.cs │ │ ├── JavaScript │ │ │ ├── JavaScriptEmbeddedExtension.cs │ │ │ ├── JavaScriptExtensionTest.cs │ │ │ └── JavaScriptLinkedExtension.cs │ │ ├── Listener │ │ │ ├── AssertLogger.cs │ │ │ ├── ExecuteLogger.cs │ │ │ ├── ExecuteTableListenerTest.cs │ │ │ ├── ListenerTest.cs │ │ │ ├── LoggingExtension.cs │ │ │ ├── VerifyRowsListenerTest.cs │ │ │ └── VerifyRowsLogger.cs │ │ └── Resource │ │ │ ├── DynamicResourceExtension.cs │ │ │ ├── ResourceExtension.cs │ │ │ └── ResourceExtensionTest.cs │ ├── Integration │ │ ├── ConstructorTest.cs │ │ ├── IntegrationTest.cs │ │ ├── NUnitRunnerTest.cs │ │ └── SetupMethodTest.cs │ └── Results │ │ ├── AssertEquals │ │ ├── Failure │ │ │ ├── AnchorsTest.cs │ │ │ ├── EmptyFailureTest.cs │ │ │ ├── FailureTest.cs │ │ │ └── NestedElementsTest.cs │ │ └── Success │ │ │ ├── EmptySuccessTest.cs │ │ │ ├── HasAttributesTest.cs │ │ │ ├── HasClassAttributeTest.cs │ │ │ └── SuccessTest.cs │ │ ├── AssertFalse │ │ ├── Failure │ │ │ └── OnFailureTest.cs │ │ └── Success │ │ │ └── OnSuccessTest.cs │ │ ├── AssertTrue │ │ ├── Failure │ │ │ └── FailureTest.cs │ │ └── Success │ │ │ └── SuccessTest.cs │ │ ├── Breadcrumbs │ │ ├── AbstractBreadcrumbsTest.cs │ │ ├── BreadcrumbsTest.cs │ │ ├── DeterminingBreadcrumbsTest.cs │ │ └── WordingTest.cs │ │ ├── Exception │ │ └── ExceptionTest.cs │ │ └── ResultsTest.cs ├── Examples │ ├── DemoTest.cs │ ├── PartialMatchesTest.cs │ └── SpikeTest.cs ├── Properties │ └── AssemblyInfo.cs ├── Support │ ├── EventRecorder.cs │ ├── ProcessingResult.cs │ ├── StackTraceSettingException.cs │ ├── StubEvaluator.cs │ ├── StubSource.cs │ ├── StubTarget.cs │ └── TestRig.cs └── concordion.css ├── Concordion.Test ├── Api │ └── Resource_Fixture.cs ├── Concordion.Test.csproj ├── Integration │ └── FileTarget_Fixture.cs ├── Internal │ ├── DummyContainingTestInNameTest.cs │ └── SpecificationLocatorTest.cs ├── Listener │ ├── DocumentStructureImproverTest.cs │ ├── JavaScriptLinkerTest.cs │ └── MetadataCreatorTest.cs ├── Properties │ └── AssemblyInfo.cs ├── StringExtensions_Fixture.cs ├── Support │ └── HtmlUtil.cs └── TestObject │ └── DemoTest.cs ├── Concordion.msbuild ├── Concordion.vs2010.sln ├── Concordion.vs2012.sln ├── Concordion.vsmdi ├── Concordion ├── Api │ ├── AbstractCommand.cs │ ├── AssertionErrorException.cs │ ├── Element.cs │ ├── ExpectedToFailAttribute.cs │ ├── ExpectedToPassAttribute.cs │ ├── Extension │ │ ├── ExtensionAttribute.cs │ │ ├── ExtensionsAttribute.cs │ │ ├── IConcordionExtender.cs │ │ ├── IConcordionExtension.cs │ │ └── IConcordionExtensionFactory.cs │ ├── ICommand.cs │ ├── ICommandFactory.cs │ ├── IContext.cs │ ├── IEvaluator.cs │ ├── IEvaluatorFactory.cs │ ├── IResultRecorder.cs │ ├── IResultSummary.cs │ ├── IRunner.cs │ ├── ISource.cs │ ├── ISpecification.cs │ ├── ISpecificationLocator.cs │ ├── ISpecificationReader.cs │ ├── ITarget.cs │ ├── Listener │ │ ├── AssertFailureEvent.cs │ │ ├── AssertSuccessEvent.cs │ │ ├── ConcordionBuildEvent.cs │ │ ├── ExceptionCaughtEvent.cs │ │ ├── ExecuteEvent.cs │ │ ├── ExpressionEvaluatedEvent.java.cs │ │ ├── IAssertEqualsListener.cs │ │ ├── IAssertFalseListener.cs │ │ ├── IAssertListener.cs │ │ ├── IAssertTrueListener.cs │ │ ├── IConcordionBuildListener.cs │ │ ├── IDocumentParsingListener.cs │ │ ├── IExceptionCaughtListener.cs │ │ ├── IExecuteListener.cs │ │ ├── IRunListener.cs │ │ ├── ISpecificationProcessingListener.cs │ │ ├── IVerifyRowsListener.cs │ │ ├── MissingRowEvent.cs │ │ ├── RunFailureEvent.cs │ │ ├── RunIgnoreEvent.cs │ │ ├── RunSuccessEvent.cs │ │ ├── SpecificationProcessingEvent.cs │ │ └── SurplusRowEvent.cs │ ├── Resource.cs │ ├── Result.cs │ ├── ResultDetails.cs │ ├── RunnerResult.cs │ └── UnimplementedAttribute.cs ├── Concordion.config ├── Concordion.cs ├── Concordion.csproj ├── GlobalSuppressions.cs ├── HtmlFramework.Designer.cs ├── HtmlFramework.resx ├── Integration │ ├── ConcordionAssemblyAttribute.cs │ └── ConcordionTestAttribute.cs ├── Internal │ ├── AbstractCheckerBase.cs │ ├── BannedWordsValidator.cs │ ├── BooleanExpectationChecker.cs │ ├── BrowserStyleWhitespaceComparer.cs │ ├── ChainOfExpectationCheckers.cs │ ├── ClassNameBasedSpecificationLocator.cs │ ├── CommandCall.cs │ ├── CommandCallList.cs │ ├── CommandRegistry.cs │ ├── Commands │ │ ├── AbstractCommandDecorator.cs │ │ ├── AssertEqualsCommand.cs │ │ ├── AssertFalseCommand.cs │ │ ├── AssertTrueCommand.cs │ │ ├── BooleanCommand.cs │ │ ├── DefaultExecuteStrategy.cs │ │ ├── EchoCommand.cs │ │ ├── ExceptionCatchingDecorator.cs │ │ ├── ExecuteCommand.cs │ │ ├── IExecuteStrategy.cs │ │ ├── ListExecuteStrategy.cs │ │ ├── LocalTextDecorator.cs │ │ ├── RunCommand.cs │ │ ├── SetCommand.cs │ │ ├── SpecificationCommand.cs │ │ ├── TableExecuteStrategy.cs │ │ └── VerifyRowsCommand.cs │ ├── ConcordionAssertionException.cs │ ├── ConcordionBuilder.cs │ ├── ConcordionConfig.cs │ ├── ConcordionConfigParser.cs │ ├── ConcordionModule.cs │ ├── DefaultExpectationChecker.cs │ ├── DocumentParser.cs │ ├── EmbeddedResourceSource.cs │ ├── ExpectedToFailFixtureState.cs │ ├── ExpectedToPassFixtureState.cs │ ├── Extension │ │ └── ExtensionLoader.cs │ ├── FileSource.cs │ ├── FileTarget.cs │ ├── FixtureRunner.cs │ ├── IExpectationChecker.cs │ ├── IExpressionValidator.cs │ ├── IFixtureState.cs │ ├── ListEntry.cs │ ├── ListSupport.cs │ ├── Listener │ │ ├── AssertResultRenderer.cs │ │ ├── BreadCrumbRenderer.cs │ │ ├── DocumentStructureImprover.cs │ │ ├── ExceptionRenderer.cs │ │ ├── JavaScriptEmbedder.cs │ │ ├── JavaScriptLinker.cs │ │ ├── MetadataCreator.cs │ │ ├── PageFooterRenderer.cs │ │ ├── RunResultRenderer.cs │ │ ├── SpecificationRenderer.cs │ │ ├── StylesheetEmbedder.cs │ │ ├── StylesheetLinker.cs │ │ └── VerifyRowResultRenderer.cs │ ├── ObjectFactory.cs │ ├── OgnlEvaluator.cs │ ├── ParsingEventArgs.cs │ ├── Row.cs │ ├── Runner │ │ └── DefaultConcordionRunner.cs │ ├── SimpleEvaluator.cs │ ├── SimpleEvaluatorFactory.cs │ ├── SpecificationConfig.cs │ ├── SpecificationConfigParser.cs │ ├── StringExtensionMethods.cs │ ├── SummarizingResultRecorder.cs │ ├── Table.cs │ ├── TableSupport.cs │ ├── UnimplementedFixtureState.cs │ ├── Util │ │ ├── Announcer.cs │ │ ├── Check.cs │ │ ├── IOUtil.cs │ │ └── TypeInfo.cs │ ├── XmlSpecification.cs │ └── XmlSpecificationReader.cs ├── Properties │ └── AssemblyInfo.cs └── Resources │ ├── embedded.css │ ├── logo.png │ └── visibility-toggler.js ├── LICENSE.md ├── License.txt ├── README.md ├── build.cmd ├── doc ├── AdvancedFeatures.html ├── BestPractices.html ├── Concordion │ ├── Attributes │ │ ├── Attributes.html │ │ ├── ConcordionTestAttribute.html │ │ └── IgnoreAttribute.html │ ├── Command │ │ ├── AssertEquals │ │ │ ├── AssertEquals.html │ │ │ ├── CaseSensitive.html │ │ │ ├── Exceptions.html │ │ │ ├── NestedActions.html │ │ │ ├── NestedHtmlElements.html │ │ │ ├── NonString │ │ │ │ ├── Boolean.html │ │ │ │ ├── NonString.html │ │ │ │ ├── NullResult.html │ │ │ │ └── VoidResult.html │ │ │ ├── SupportedElements.html │ │ │ ├── Whitespace │ │ │ │ ├── LineContinuations.html │ │ │ │ ├── Normalization.html │ │ │ │ └── Whitespace.html │ │ │ └── contents.html │ │ ├── AssertFalse │ │ │ └── AssertFalse.html │ │ ├── AssertTrue │ │ │ └── AssertTrue.html │ │ ├── CaseInsensitiveCommands.html │ │ ├── Command.html │ │ ├── Echo │ │ │ ├── DisplayingNulls.html │ │ │ ├── Echo.html │ │ │ └── EscapingHtmlCharacters.html │ │ ├── EvaluatingCommands.html │ │ ├── Execute │ │ │ ├── AccessToLinkHref.html │ │ │ ├── Execute.html │ │ │ ├── ExecutingList.html │ │ │ └── ExecutingTables.html │ │ ├── Results │ │ │ └── Stylesheet │ │ │ │ ├── MissingHeadElement.html │ │ │ │ └── Stylesheet.html │ │ ├── Run │ │ │ └── Run.html │ │ ├── Set │ │ │ └── Set.html │ │ └── VerifyRows │ │ │ ├── Results │ │ │ ├── MissingRows.html │ │ │ └── SurplusRows.html │ │ │ ├── TableBodySupport.html │ │ │ ├── VerifyRows.html │ │ │ └── VerifyRowsXHTMLNamespace.html │ ├── Concordion.html │ ├── Configuration │ │ ├── BaseInputDirectory.html │ │ ├── BaseOutputDirectory.html │ │ ├── SpecificationSuffix.html │ │ ├── SpecificationSuffixXhtml.html │ │ └── SpecificationSuffixXhtml.xhtml │ ├── Example.html │ ├── Extension │ │ ├── Command │ │ │ └── CustomCommand.html │ │ ├── Configuration │ │ │ └── ExtensionConfiguration.html │ │ ├── Css │ │ │ └── CssExtension.html │ │ ├── Extension.html │ │ ├── FileSuffix │ │ │ └── FileSuffixExtensions.xhtml │ │ ├── JavaScript │ │ │ └── JavaScriptExtension.html │ │ ├── Listener │ │ │ ├── ExecuteTableListener.html │ │ │ ├── Listener.html │ │ │ └── VerifyRowsListener.html │ │ └── Resource │ │ │ └── ResourceExtension.html │ ├── Integration │ │ ├── Constructor.html │ │ ├── Integration.html │ │ ├── NUnitRunner.html │ │ ├── ReSharper.html │ │ └── SetupMethod.html │ ├── Results │ │ ├── AssertEquals │ │ │ ├── Failure │ │ │ │ ├── Anchors.html │ │ │ │ ├── EmptyFailure.html │ │ │ │ ├── Failure.html │ │ │ │ └── NestedElements.html │ │ │ └── Success │ │ │ │ ├── EmptySuccess.html │ │ │ │ ├── HasAttributes.html │ │ │ │ ├── HasClassAttribute.html │ │ │ │ └── Success.html │ │ ├── AssertFalse │ │ │ ├── Failure │ │ │ │ └── OnFailure.html │ │ │ └── Success │ │ │ │ └── OnSuccess.html │ │ ├── AssertTrue │ │ │ ├── Failure │ │ │ │ └── Failure.html │ │ │ └── Success │ │ │ │ └── Success.html │ │ ├── Breadcrumbs │ │ │ ├── Breadcrumbs.html │ │ │ ├── DeterminingBreadcrumbs.html │ │ │ └── Wording.html │ │ ├── Exception │ │ │ └── Exception.html │ │ └── Results.html │ └── Setup.html ├── Configuration.html ├── Download.html ├── Example.html ├── Examples │ ├── Demo.html │ ├── PartialMatches.html │ └── Spike.html ├── Extensions.html ├── GettingStarted.html ├── README.md ├── RunningTests.html ├── Spec │ └── 1.1.0 │ │ ├── Concordion │ │ ├── Attributes │ │ │ ├── Attributes.html │ │ │ ├── ConcordionTestAttribute.html │ │ │ └── IgnoreAttribute.html │ │ ├── Command │ │ │ ├── AssertEquals │ │ │ │ ├── AssertEquals.html │ │ │ │ ├── Exceptions.html │ │ │ │ ├── NestedActions.html │ │ │ │ ├── NestedHtmlElements.html │ │ │ │ ├── NonString │ │ │ │ │ ├── Boolean.html │ │ │ │ │ ├── NonString.html │ │ │ │ │ ├── NullResult.html │ │ │ │ │ └── VoidResult.html │ │ │ │ ├── SupportedElements.html │ │ │ │ └── Whitespace │ │ │ │ │ ├── LineContinuations.html │ │ │ │ │ ├── Normalization.html │ │ │ │ │ └── Whitespace.html │ │ │ ├── AssertFalse │ │ │ │ └── AssertFalse.html │ │ │ ├── AssertTrue │ │ │ │ └── AssertTrue.html │ │ │ ├── CaseInsensitiveCommands.html │ │ │ ├── Command.html │ │ │ ├── Echo │ │ │ │ ├── DisplayingNulls.html │ │ │ │ ├── Echo.html │ │ │ │ └── EscapingHtmlCharacters.html │ │ │ ├── Execute │ │ │ │ ├── AccessToLinkHref.html │ │ │ │ ├── Execute.html │ │ │ │ ├── ExecutingList.html │ │ │ │ └── ExecutingTables.html │ │ │ ├── Results │ │ │ │ └── Stylesheet │ │ │ │ │ ├── MissingHeadElement.html │ │ │ │ │ └── Stylesheet.html │ │ │ ├── Run │ │ │ │ └── Run.html │ │ │ ├── Set │ │ │ │ └── Set.html │ │ │ └── VerifyRows │ │ │ │ ├── Results │ │ │ │ ├── MissingRows.html │ │ │ │ └── SurplusRows.html │ │ │ │ ├── TableBodySupport.html │ │ │ │ └── VerifyRows.html │ │ ├── Concordion.html │ │ ├── Example.html │ │ ├── Integration │ │ │ ├── Constructor.html │ │ │ ├── Integration.html │ │ │ └── SetupMethod.html │ │ └── Results │ │ │ ├── AssertEquals │ │ │ ├── Failure │ │ │ │ ├── Anchors.html │ │ │ │ ├── EmptyFailure.html │ │ │ │ ├── Failure.html │ │ │ │ └── NestedElements.html │ │ │ └── Success │ │ │ │ ├── EmptySuccess.html │ │ │ │ ├── HasAttributes.html │ │ │ │ ├── HasClassAttribute.html │ │ │ │ └── Success.html │ │ │ ├── AssertTrue │ │ │ ├── Failure │ │ │ │ └── Failure.html │ │ │ └── Success │ │ │ │ └── Success.html │ │ │ ├── Breadcrumbs │ │ │ ├── Breadcrumbs.html │ │ │ ├── DeterminingBreadcrumbs.html │ │ │ └── Wording.html │ │ │ ├── Exception │ │ │ └── Exception.html │ │ │ └── Results.html │ │ └── Examples │ │ ├── Demo.html │ │ ├── PartialMatches.html │ │ └── Spike.html ├── Specification.html ├── concordion.css ├── css │ ├── default.css │ └── print.css ├── image │ ├── AnatomyOfAnActiveSpec.jpg │ ├── ClassicalSpecification.jpg │ ├── DocumentationSpecification.jpg │ ├── ExternalLink.png │ ├── HelloWorldSuccess.jpg │ ├── HowItWorks.jpg │ ├── NuGet_logo.png │ ├── NunitResult.jpg │ ├── ReSharperSessions.jpg │ ├── SpecificationProperties.jpg │ ├── concordion-logo.png │ ├── download.gif │ ├── example │ │ └── online-shop │ │ │ ├── AcceptanceTest.png │ │ │ ├── ConcordionRunExample.png │ │ │ ├── RoughScope.png │ │ │ ├── StoryCard.png │ │ │ └── StoryPage.png │ ├── favicon.ico │ ├── flag │ │ ├── chinese.png │ │ ├── french.png │ │ ├── german.png │ │ ├── polish.png │ │ ├── portuguese.png │ │ ├── russian.png │ │ └── spanish.png │ ├── front-page-banner.png │ ├── opensource-110x95.png │ ├── project-structure.jpg │ └── social │ │ ├── facebook.png │ │ ├── google-plus.png │ │ ├── linkedin.png │ │ ├── pinterest.png │ │ └── twitter.png └── index.html └── tools ├── MSBuildCommunityTasks ├── ICSharpCode.SharpZipLib.dll ├── MSBuild.Community.Tasks.License.txt ├── MSBuild.Community.Tasks.Targets ├── MSBuild.Community.Tasks.chm ├── MSBuild.Community.Tasks.dll ├── MSBuild.Community.Tasks.pdb ├── MSBuild.Community.Tasks.xml ├── MSBuild.Community.Tasks.xsd └── Sample.proj ├── Moq ├── Moq.License.txt ├── Moq.chm ├── Moq.dll ├── Moq.pdb └── Moq.xml ├── NUnit-2.6.4 ├── nunit.core.dll ├── nunit.core.interfaces.dll └── nunit.framework.dll ├── Ninject └── Ninject.dll └── OGNL.NET ├── OGNL.Net.source-modified-for-concordion.7z ├── OGNL.dll └── OGNLNET.License.txt /.gitignore: -------------------------------------------------------------------------------- 1 | bin 2 | obj 3 | *.suo 4 | *.user 5 | *.VisualState.xml 6 | TestResult.xml 7 | _ReSharper.* 8 | packages 9 | -------------------------------------------------------------------------------- /Concordion.NUnit/Addin/SuiteBuilderAddin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Concordion.Integration; 5 | using NUnit.Core; 6 | using NUnit.Core.Extensibility; 7 | 8 | namespace Concordion.NUnit.Addin 9 | { 10 | [NUnitAddin(Name = "ConcordionNUnitAddin", Description = "Runs Concordion Tests with NUnit", Type = ExtensionType.Core)] 11 | public class SuiteBuilderAddin : ISuiteBuilder, IAddin 12 | { 13 | #region Implementation of ISuiteBuilder 14 | 15 | public bool CanBuildFrom(Type type) 16 | { 17 | return Reflect.HasAttribute(type, ConcordionTestAttribute.AttributeIdentifier, false); 18 | } 19 | 20 | public Test BuildFrom(Type type) 21 | { 22 | var testFixture = new ConcordionTestFixture(type); 23 | testFixture.Add(new ConcordionTest(type)); 24 | NUnitFramework.ApplyCommonAttributes(type, testFixture); 25 | return testFixture; 26 | } 27 | 28 | #endregion 29 | 30 | #region Implementation of IAddin 31 | 32 | public bool Install(IExtensionHost host) 33 | { 34 | IExtensionPoint extensionPoint = host.GetExtensionPoint("SuiteBuilders"); 35 | if (extensionPoint == null) return false; 36 | extensionPoint.Install(this); 37 | return true; 38 | } 39 | 40 | #endregion 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Concordion.NUnit/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Concordion.NUnit")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("concordion.org")] 12 | [assembly: AssemblyProduct("Concordion.NUnit")] 13 | [assembly: AssemblyCopyright("Copyright © concordion.org 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("eeae529a-67b7-4fc1-9ffa-695046515ca8")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Concordion.Runners/NUnit/ExecutableSpecification.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Xml.Linq; 5 | using Concordion.Internal; 6 | using NUnit.Framework; 7 | 8 | namespace Concordion.Runners.NUnit 9 | { 10 | [TestFixture] 11 | public class ExecutableSpecification 12 | { 13 | 14 | [Test] 15 | public void ConcordionTest() 16 | { 17 | var concordionResult = new FixtureRunner().Run(this); 18 | if (concordionResult.HasExceptions) 19 | { 20 | throw new Exception("Exception in Concordion test: please see Concordion test reports"); 21 | } 22 | else if (concordionResult.HasFailures) 23 | { 24 | Assert.Fail("Concordion Test Failures: " + concordionResult.FailureCount, 25 | "for stack trace, please see Concordion test reports"); 26 | } 27 | else 28 | { 29 | Assert.Pass(); 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Concordion.Runners/NUnit/ExecutableSpecification.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AssertEquals 6 | 7 | 8 | 9 | 10 |

Test Runner

11 |

To run Concordion.NET acceptance tests without the need for addins, you have to derive your 12 | test fixtures from the Concordion.Runners.NUnit.ExecutableSpecification class 13 | and annotate it with the standard NUnit [TestFixture] 14 | annotation.

15 |

The HelloWorldTest fixture from the 16 | Concordion.NET 17 | tutorial would need to be adapted as follows:

18 |
19 | using Concordion.Runners.NUnit;
20 | 
21 | namespace Kickstart.Spec.HelloWorld
22 | {
23 |     [TestFixture]
24 |     public class HelloWorldTest : ExecutableSpecification
25 |     {
26 |         private readonly Greeter m_HelloWorldGreeter = new Greeter();
27 | 
28 |         public string GetGreeting()
29 |         {
30 |             return m_HelloWorldGreeter.GetMessage();
31 |         }
32 |     } 
33 | }
34 |

Now you can run your 35 | Concordion.NET acceptance tests with the NUnit runner of your choice.

36 | 37 | 38 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion.Spec.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 21 | 22 | 27 | 28 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Attributes/AttributesTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Concordion.Integration; 5 | 6 | namespace Concordion.Spec.Concordion.Attributes 7 | { 8 | [ConcordionTest] 9 | public class AttributesTest 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Attributes/ConcordionTestAttributeTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Concordion.Integration; 5 | 6 | namespace Concordion.Spec.Concordion.Attributes 7 | { 8 | [ConcordionTest] 9 | public class ConcordionTestAttributeTest 10 | { 11 | public bool HasBeenProcessed() 12 | { 13 | return true; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Attributes/ExampleIgnoreTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Concordion.Integration; 5 | using NUnit.Framework; 6 | 7 | namespace Concordion.Spec.Concordion.Attributes 8 | { 9 | //This examples shows how to exclude a Concordion.NET test from execution by using the NUnit [Ignore] tribute. 10 | //Please, comment in the following two lines containing the attributes - it has been commented out to prevent a yellow line when running all Concordion.NET tests. 11 | //[Ignore] 12 | //[ConcordionTest] 13 | public class ExampleIgnoreTest 14 | { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Attributes/IgnoreAttributeTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Linq; 5 | using Concordion.Integration; 6 | //using Concordion.NUnit.Addin; 7 | //using NUnit.Core; 8 | using NUnit.Framework; 9 | 10 | namespace Concordion.Spec.Concordion.Attributes 11 | { 12 | //To run this test pleas use the following attribute and 13 | //additionally comment in also the attributes on the class "ExampleIgnoreTest.cs". 14 | //The necessary reference on NUnit.core prohibits running Concordion.NET tests with TestDriven.NET 15 | //[ConcordionTest] 16 | public class IgnoreAttributeTest 17 | { 18 | //public bool IsExampleTestIgnored() 19 | //{ 20 | // var suiteBuilderAddin = new SuiteBuilderAddin(); 21 | // var testWithIgnoreAttribute = suiteBuilderAddin.BuildFrom(typeof(ExampleIgnoreTest)); 22 | // var testResult = testWithIgnoreAttribute.Run(new NullListener(), TestFilter.Empty); 23 | // return !testResult.Executed; 24 | //} 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Command/AssertEquals/AssertEqualsTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Concordion.Integration; 4 | using Concordion.Spec.Support; 5 | 6 | namespace Concordion.Spec.Concordion.Command.AssertEquals 7 | { 8 | [ConcordionTest] 9 | public class AssertEqualsTest 10 | { 11 | public bool GreetingsProcessed(string fragment) 12 | { 13 | return new TestRig() 14 | .WithFixture(this) 15 | .ProcessFragment(fragment) 16 | .IsSuccess; 17 | } 18 | 19 | public string GetGreeting() 20 | { 21 | return new Greeter().GetMessage(); 22 | } 23 | } 24 | 25 | public class Greeter 26 | { 27 | public static string greeting = "Hello World!"; 28 | 29 | public string GetMessage() 30 | { 31 | return greeting; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Command/AssertEquals/CaseSensitiveTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | using Concordion.Spec.Support; 7 | 8 | namespace Concordion.Spec.Concordion.Command.AssertEquals 9 | { 10 | [ConcordionTest] 11 | public class CaseSensitiveTest 12 | { 13 | public string successOrFailure(string fragment, string evaluationResult) 14 | { 15 | return new TestRig() 16 | .WithStubbedEvaluationResult(evaluationResult) 17 | .ProcessFragment(fragment) 18 | .SuccessOrFailureInWords(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Command/AssertEquals/ExceptionsTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | using Concordion.Spec.Support; 7 | 8 | namespace Concordion.Spec.Concordion.Command.AssertEquals 9 | { 10 | [ConcordionTest] 11 | public class ExceptionsTest 12 | { 13 | string successCount; 14 | 15 | public object countsFromExecutingSnippetWithSimulatedEvaluationResult(string snippet, string simulatedResult) 16 | { 17 | TestRig harness = new TestRig(); 18 | if (simulatedResult.Equals("(An exception)")) 19 | { 20 | harness.WithStubbedEvaluationResult(new Exception("simulated exception")); 21 | } 22 | else 23 | { 24 | harness.WithStubbedEvaluationResult(simulatedResult); 25 | } 26 | return harness.ProcessFragment(snippet); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Command/AssertEquals/NestedActionsTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | 7 | namespace Concordion.Spec.Concordion.Command.AssertEquals 8 | { 9 | [ConcordionTest] 10 | public class NestedActionsTest 11 | { 12 | // TODO - implement, also unimplemented in Java version 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Command/AssertEquals/NestedHtmlElementsTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | using Concordion.Spec.Support; 7 | 8 | namespace Concordion.Spec.Concordion.Command.AssertEquals 9 | { 10 | [ConcordionTest] 11 | public class NestedHtmlElementsTest 12 | { 13 | public string matchOrNotMatch(string snippet, string evaluationResult) 14 | { 15 | return new TestRig() 16 | .WithStubbedEvaluationResult(evaluationResult) 17 | .ProcessFragment(snippet) 18 | .HasFailures ? "not match" : "match"; 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Command/AssertEquals/NonString/BooleanTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Globalization; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Text.RegularExpressions; 7 | using Concordion.Integration; 8 | using Concordion.Spec.Support; 9 | 10 | namespace Concordion.Spec.Concordion.Command.AssertEquals.NonString 11 | { 12 | [ConcordionTest] 13 | public class BooleanTest 14 | { 15 | public string OutcomeOfPerformingAssertEquals(string fragment, bool boolValue, string boolString) 16 | { 17 | return new TestRig() 18 | .WithStubbedEvaluationResult(boolValue) 19 | .ProcessFragment(Regex.Replace(fragment, "\\(some boolean string\\)", boolString)) 20 | .SuccessOrFailureInWords(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Command/AssertEquals/NonString/NullResultTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | using System.Text.RegularExpressions; 7 | using Concordion.Spec.Support; 8 | 9 | namespace Concordion.Spec.Concordion.Command.AssertEquals.NonString 10 | { 11 | [ConcordionTest] 12 | public class NullResultTest 13 | { 14 | public string outcomeOfPerformingAssertEquals(string snippet, string expectedString, string result) 15 | { 16 | if (result.Equals("null")) 17 | { 18 | result = null; 19 | } 20 | 21 | snippet = Regex.Replace(snippet, "\\(some expectation\\)", expectedString); 22 | 23 | return new TestRig() 24 | .WithStubbedEvaluationResult(result) 25 | .ProcessFragment(snippet) 26 | .SuccessOrFailureInWords(); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Command/AssertEquals/NonString/VoidResultTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | using Concordion.Spec.Support; 7 | 8 | namespace Concordion.Spec.Concordion.Command.AssertEquals.NonString 9 | { 10 | [ConcordionTest] 11 | public class VoidResultTest 12 | { 13 | public string process(string snippet) 14 | { 15 | ProcessingResult r = new TestRig() 16 | .WithFixture(this) 17 | .ProcessFragment(snippet); 18 | 19 | if (r.ExceptionCount != 0) 20 | { 21 | return "exception"; 22 | } 23 | 24 | return r.SuccessOrFailureInWords(); 25 | } 26 | 27 | public void myVoidMethod() 28 | { 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Command/AssertEquals/SupportedElementsTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | using Concordion.Spec.Support; 7 | 8 | namespace Concordion.Spec.Concordion.Command.AssertEquals 9 | { 10 | [ConcordionTest] 11 | public class SupportedElementsTest 12 | { 13 | public string process(string snippet) 14 | { 15 | long successCount = new TestRig() 16 | .WithStubbedEvaluationResult("Fred") 17 | .ProcessFragment(snippet) 18 | .SuccessCount; 19 | 20 | return successCount == 1 ? snippet : "Did not work"; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Command/AssertEquals/Whitespace/NormalizationTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | 7 | namespace Concordion.Spec.Concordion.Command.AssertEquals.Whitespace 8 | { 9 | [ConcordionTest] 10 | public class NormalizationTest : WhitespaceTest 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Command/AssertFalse/AssertFalseTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | using Concordion.Spec.Support; 7 | 8 | namespace Concordion.Spec.Concordion.Command.AssertFalse 9 | { 10 | [ConcordionTest] 11 | public class AssertFalseTest 12 | { 13 | public string successOrFailure(string fragment, string evaluationResult) 14 | { 15 | return new TestRig() 16 | .WithStubbedEvaluationResult(Boolean.Parse(evaluationResult)) 17 | .ProcessFragment(fragment) 18 | .SuccessOrFailureInWords(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Command/AssertTrue/AssertTrueTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | using Concordion.Spec.Support; 7 | 8 | namespace Concordion.Spec.Concordion.Command.AssertTrue 9 | { 10 | [ConcordionTest] 11 | public class AssertTrueTest 12 | { 13 | public string successOrFailure(string fragment, string evaluationResult) 14 | { 15 | return new TestRig() 16 | .WithStubbedEvaluationResult(Boolean.Parse(evaluationResult)) 17 | .ProcessFragment(fragment) 18 | .SuccessOrFailureInWords(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Command/CaseInsensitiveCommandsTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Concordion.Integration; 5 | using Concordion.Spec.Support; 6 | 7 | namespace Concordion.Spec.Concordion.Command 8 | { 9 | [ConcordionTest] 10 | public class CaseInsensitiveCommands 11 | { 12 | public string process(string snippet, object stubbedResult) 13 | { 14 | long successCount = new TestRig() 15 | .WithStubbedEvaluationResult(stubbedResult) 16 | .ProcessFragment(snippet) 17 | .SuccessCount; 18 | 19 | return successCount == 1 ? snippet : "Did not work"; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Command/CommandTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | 7 | namespace Concordion.Spec.Concordion.Command 8 | { 9 | [ConcordionTest] 10 | public class CommandTest 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Command/Echo/DisplayingNullsTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Internal; 6 | using Concordion.Integration; 7 | using Concordion.Spec.Support; 8 | 9 | namespace Concordion.Spec.Concordion.Command.Echo 10 | { 11 | [ConcordionTest] 12 | public class DisplayingNullsTest 13 | { 14 | public string render(string fragment) 15 | { 16 | return new TestRig() 17 | .WithStubbedEvaluationResult(null) 18 | .ProcessFragment(fragment) 19 | .GetOutputFragmentXML() 20 | .Replace(" concordion:echo=\"username\">", ">"); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Command/Echo/EchoTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | using Concordion.Spec.Support; 7 | 8 | namespace Concordion.Spec.Concordion.Command.Echo 9 | { 10 | [ConcordionTest] 11 | public class EchoTest 12 | { 13 | private string nextResult; 14 | 15 | public void setNextResult(string nextResult) 16 | { 17 | this.nextResult = nextResult; 18 | } 19 | 20 | public string render(string fragment) 21 | { 22 | return new TestRig() 23 | .WithStubbedEvaluationResult(nextResult) 24 | .ProcessFragment(fragment) 25 | .GetOutputFragmentXML(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Command/Echo/EscapingHtmlCharactersTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | using Concordion.Spec.Support; 7 | 8 | namespace Concordion.Spec.Concordion.Command.Echo 9 | { 10 | [ConcordionTest] 11 | public class EscapingHtmlCharactersTest 12 | { 13 | public string render(string fragment, string evalResult) 14 | { 15 | return new TestRig() 16 | .WithStubbedEvaluationResult(evalResult) 17 | .ProcessFragment(fragment) 18 | .GetOutputFragmentXML() 19 | .Replace(" concordion:echo=\"username\">", ">"); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Command/EvaluatingCommandsTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using Concordion.Integration; 7 | using NUnit.Framework; 8 | 9 | namespace Concordion.Spec.Concordion.Command 10 | { 11 | [ConcordionTest] 12 | public class EvaluatingCommandsTest 13 | { 14 | public static string assertEqualsResult = "assertequals"; 15 | 16 | public static bool assertTrueResult = true; 17 | 18 | public static bool assertFalseResult = false; 19 | 20 | public static Exception exceptionResult; 21 | 22 | public static IList verifyRowsResult = new[] { "value1", "value2" }; 23 | 24 | public string ForAssertEquals() 25 | { 26 | return assertEqualsResult; 27 | } 28 | 29 | public bool ForAssertTrue() 30 | { 31 | return assertTrueResult; 32 | } 33 | 34 | public bool ForAssertFalse() 35 | { 36 | return assertFalseResult; 37 | } 38 | 39 | public void ForException() 40 | { 41 | if (exceptionResult != null) 42 | { 43 | throw exceptionResult; 44 | } 45 | } 46 | 47 | public IEnumerable ForVerifyRows() 48 | { 49 | return verifyRowsResult; 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Command/Execute/AccessToLinkHrefTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | using Concordion.Spec.Support; 7 | 8 | namespace Concordion.Spec.Concordion.Command.Execute 9 | { 10 | [ConcordionTest] 11 | public class AccessToLinkHrefTest 12 | { 13 | public bool fragmentSucceeds(string fragment) 14 | { 15 | ProcessingResult result = new TestRig() 16 | .WithFixture(this) 17 | .ProcessFragment(fragment); 18 | 19 | return result.IsSuccess && result.SuccessCount > 0; 20 | } 21 | 22 | public string myMethod(string s) 23 | { 24 | return s; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Command/Execute/ExecuteTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | using Concordion.Spec.Support; 7 | 8 | namespace Concordion.Spec.Concordion.Command.Execute 9 | { 10 | [ConcordionTest] 11 | public class ExecuteTest 12 | { 13 | private bool myMethodWasCalled = false; 14 | 15 | public bool myMethodWasCalledProcessing(string fragment) 16 | { 17 | new TestRig() 18 | .WithFixture(this) 19 | .ProcessFragment(fragment); 20 | return myMethodWasCalled; 21 | } 22 | 23 | public void myMethod() 24 | { 25 | myMethodWasCalled = true; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Command/Execute/ExecutingListTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | using Concordion.Spec.Support; 7 | 8 | namespace Concordion.Spec.Concordion.Command.Execute 9 | { 10 | [ConcordionTest] 11 | public class ExecutingListTest 12 | { 13 | private Queue nodes = new Queue(); 14 | 15 | public void ParseNode(string text, int level) 16 | { 17 | ParseParameters parseParameters = new ParseParameters(); 18 | parseParameters.Name = text; 19 | parseParameters.Level = level; 20 | nodes.Enqueue(parseParameters); 21 | } 22 | 23 | public struct ParseParameters 24 | { 25 | public string Name; 26 | public int Level; 27 | } 28 | 29 | public Queue GetNodes() 30 | { 31 | return nodes; 32 | } 33 | 34 | public void process(string fragment) 35 | { 36 | ProcessingResult r = new TestRig() 37 | .WithFixture(this) 38 | .ProcessFragment(fragment); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Command/Run/RunTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Api; 6 | using Concordion.Integration; 7 | using Concordion.Spec.Support; 8 | 9 | namespace Concordion.Spec.Concordion.Command.Run 10 | { 11 | [ConcordionTest] 12 | public class RunTest 13 | { 14 | public String successOrFailure(String fragment, String hardCodedTestResult, String evaluationResult) 15 | { 16 | RunTestRunner.Result = (Result)Enum.Parse(typeof(Result), hardCodedTestResult, true); 17 | return new TestRig() 18 | .WithStubbedEvaluationResult(evaluationResult) 19 | .ProcessFragment(fragment) 20 | .SuccessOrFailureInWords(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Command/Run/RunTestRunner.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Api; 6 | using Concordion.Integration; 7 | 8 | namespace Concordion.Spec.Concordion.Command.Run 9 | { 10 | class RunTestRunner : IRunner 11 | { 12 | public static Result Result; 13 | 14 | public RunnerResult Execute(object fixture, Resource resource, string href) 15 | { 16 | return new RunnerResult(Result); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Command/Set/SetTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | using Concordion.Spec.Support; 7 | 8 | namespace Concordion.Spec.Concordion.Command.Set 9 | { 10 | [ConcordionTest] 11 | public class SetTest 12 | { 13 | private string param; 14 | 15 | public void process(string fragment) 16 | { 17 | new TestRig() 18 | .WithFixture(this) 19 | .ProcessFragment(fragment); 20 | } 21 | 22 | public string getParameterPassedIn() 23 | { 24 | return param; 25 | } 26 | 27 | public void setUpUser(string fullName) 28 | { 29 | this.param = fullName; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Command/VerifyRows/Results/SurplusRowsTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | 7 | namespace Concordion.Spec.Concordion.Command.VerifyRows.Results 8 | { 9 | [ConcordionTest] 10 | public class SurplusRowsTest : MissingRowsTest 11 | { 12 | public void addPerson(string firstName, string lastName) 13 | { 14 | base.addPerson(firstName, lastName, 1973); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Command/VerifyRows/TableBodySupportTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | using System.Xml.Linq; 7 | using Concordion.Spec.Support; 8 | 9 | namespace Concordion.Spec.Concordion.Command.VerifyRows 10 | { 11 | [ConcordionTest] 12 | public class TableBodySupportTest 13 | { 14 | private List names = new List(); 15 | 16 | public void setUpNames(string namesAsCSV) 17 | { 18 | foreach (string name in namesAsCSV.Split(new char[]{',', ' '}, StringSplitOptions.RemoveEmptyEntries)) 19 | { 20 | names.Add(name); 21 | } 22 | } 23 | 24 | public List getNames() 25 | { 26 | return names; 27 | } 28 | 29 | public string process(string inputFragment) 30 | { 31 | var document = new TestRig() 32 | .WithFixture(this) 33 | .ProcessFragment(inputFragment) 34 | .GetXDocument(); 35 | 36 | var table = document.Element("html").Element("body").Element("fragment").Element("table"); 37 | 38 | return table.ToString().Replace("\u00A0", " "); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Command/VerifyRows/VerifyRowsXHTMLNamespaceTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | 7 | namespace Concordion.Spec.Concordion.Command.VerifyRows 8 | { 9 | [ConcordionTest] 10 | public class VerifyRowsXHTMLNamespaceTest : VerifyRowsTest 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/ConcordionTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | 7 | namespace Concordion.Spec.Concordion 8 | { 9 | [ConcordionTest] 10 | public class ConcordionTest 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Configuration/SpecificationSuffixXhtmlTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Api.Extension; 6 | using Concordion.Integration; 7 | using Concordion.Spec.Concordion.Extension; 8 | 9 | namespace Concordion.Spec.Concordion.Configuration 10 | { 11 | [ConcordionTest] 12 | public class SpecificationSuffixXhtmlTest 13 | { 14 | public bool HasBeenProcessed() 15 | { 16 | return true; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/ExampleTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | using Concordion.Spec.Support; 7 | 8 | namespace Concordion.Spec.Concordion 9 | { 10 | [ConcordionTest] 11 | public class ExampleTest 12 | { 13 | public string greeting = "Hello World!"; 14 | 15 | public string process(string html) 16 | { 17 | return new TestRig() 18 | .WithFixture(this) 19 | .Process(html) 20 | .SuccessOrFailureInWords() 21 | .ToLower(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Extension/Command/CommandExtension.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Concordion.Api.Extension; 3 | 4 | namespace Concordion.Spec.Concordion.Extension.Command 5 | { 6 | public class CommandExtension : IConcordionExtension 7 | { 8 | private readonly TextWriter m_LogWriter; 9 | 10 | public CommandExtension(TextWriter logWriter) 11 | { 12 | this.m_LogWriter = logWriter; 13 | } 14 | 15 | public void AddTo(IConcordionExtender concordionExtender) 16 | { 17 | concordionExtender.WithCommand("http://myorg.org/my/extension", "log", new LogCommand(this.m_LogWriter)); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Extension/Command/CustomCommandTest.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Concordion.Integration; 3 | 4 | namespace Concordion.Spec.Concordion.Extension.Command 5 | { 6 | [ConcordionTest] 7 | public class CustomCommandTest : AbstractExtensionTestCase 8 | { 9 | public void addCommandExtension() 10 | { 11 | this.Extension = new CommandExtension(LogWriter); 12 | } 13 | 14 | public List getOutput() 15 | { 16 | return this.getEventLog(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Extension/Command/LogCommand.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Concordion.Api; 3 | using Concordion.Internal; 4 | 5 | namespace Concordion.Spec.Concordion.Extension.Command 6 | { 7 | public class LogCommand : ICommand 8 | { 9 | private TextWriter LogWriter { get; set; } 10 | 11 | public LogCommand(TextWriter logWriter) 12 | { 13 | this.LogWriter = logWriter; 14 | } 15 | 16 | public void Setup(CommandCall commandCall, IEvaluator evaluator, IResultRecorder resultRecorder) 17 | { 18 | } 19 | 20 | public void Execute(CommandCall commandCall, IEvaluator evaluator, IResultRecorder resultRecorder) 21 | { 22 | this.LogWriter.WriteLine(commandCall.Element.Text); 23 | } 24 | 25 | public void Verify(CommandCall commandCall, IEvaluator evaluator, IResultRecorder resultRecorder) 26 | { 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Extension/Configuration/ExampleDerivedFixtureWithClassAttributes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Concordion.Api.Extension; 5 | 6 | namespace Concordion.Spec.Concordion.Extension.Configuration 7 | { 8 | [Extensions(typeof(FakeExtension1))] 9 | public class ExampleDerivedFixtureWithClassAttributes : ExampleFixtureBaseWithClassAttribute 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Extension/Configuration/ExampleDerivedFixtureWithFieldAttributes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Concordion.Api.Extension; 5 | 6 | namespace Concordion.Spec.Concordion.Extension.Configuration 7 | { 8 | class ExampleDerivedFixtureWithFieldAttributes : ExampleFixtureBaseWithFieldAttributes 9 | { 10 | [Extension] 11 | public IConcordionExtension extension = new FakeExtension1("ExampleExtension"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Extension/Configuration/ExampleFixtureBaseWithClassAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Concordion.Api.Extension; 5 | 6 | namespace Concordion.Spec.Concordion.Extension.Configuration 7 | { 8 | [Extensions(typeof(FakeExtension2Factory))] 9 | public class ExampleFixtureBaseWithClassAttribute 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Extension/Configuration/ExampleFixtureBaseWithFieldAttributes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Concordion.Api.Extension; 5 | 6 | namespace Concordion.Spec.Concordion.Extension.Configuration 7 | { 8 | public class ExampleFixtureBaseWithFieldAttributes 9 | { 10 | [Extension] 11 | public FakeExtension2 extension2 = new FakeExtension2("SuperExtension"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Extension/Configuration/ExampleFixtureWithClassAttributes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Concordion.Api.Extension; 5 | 6 | namespace Concordion.Spec.Concordion.Extension.Configuration 7 | { 8 | [Extensions(typeof(FakeExtension1), typeof(FakeExtension2Factory))] 9 | public class ExampleFixtureWithClassAttributes 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Extension/Configuration/ExampleFixtureWithCombinedConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Concordion.Api.Extension; 5 | 6 | namespace Concordion.Spec.Concordion.Extension.Configuration 7 | { 8 | [Extensions(typeof(FakeExtension1))] 9 | public class ExampleFixtureWithCombinedConfiguration : FakeExtensionBase 10 | { 11 | [Extension] 12 | public FakeExtension2 extension2 = new FakeExtension2(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Extension/Configuration/ExampleFixtureWithFieldAttributes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Concordion.Api.Extension; 5 | 6 | namespace Concordion.Spec.Concordion.Extension.Configuration 7 | { 8 | public class ExampleFixtureWithFieldAttributes 9 | { 10 | [Extension] 11 | public IConcordionExtension extension = new FakeExtension1(); 12 | 13 | [Extension] 14 | public FakeExtension2 extension2 = new FakeExtension2(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Extension/Configuration/ExampleFixtureWithoutExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace Concordion.Spec.Concordion.Extension.Configuration 6 | { 7 | public class ExampleFixtureWithoutExtensions 8 | { 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Extension/Configuration/FakeExtension1.cs: -------------------------------------------------------------------------------- 1 | using Concordion.Api.Extension; 2 | 3 | namespace Concordion.Spec.Concordion.Extension.Configuration 4 | { 5 | public class FakeExtension1 : FakeExtensionBase 6 | { 7 | public FakeExtension1() : base() {} 8 | 9 | public FakeExtension1(string name) : base(name) {} 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Extension/Configuration/FakeExtension2.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Concordion.Spec.Concordion.Extension.Configuration 7 | { 8 | public class FakeExtension2 : FakeExtensionBase 9 | { 10 | public FakeExtension2() : base() {} 11 | 12 | public FakeExtension2(string name) : base(name) {} 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Extension/Configuration/FakeExtension2Factory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Api.Extension; 6 | 7 | namespace Concordion.Spec.Concordion.Extension.Configuration 8 | { 9 | public class FakeExtension2Factory : IConcordionExtensionFactory 10 | { 11 | public IConcordionExtension CreateExtension() 12 | { 13 | return new FakeExtension2("FakeExtension2FromFactory"); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Extension/Configuration/FakeExtension3.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Concordion.Spec.Concordion.Extension.Configuration 7 | { 8 | public class FakeExtension3 : FakeExtensionBase 9 | { 10 | public FakeExtension3() : base() {} 11 | 12 | public FakeExtension3(string name) : base(name) {} 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Extension/Configuration/FakeExtensionBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Xml.Linq; 6 | using Concordion.Api; 7 | using Concordion.Api.Extension; 8 | using Concordion.Api.Listener; 9 | 10 | namespace Concordion.Spec.Concordion.Extension.Configuration 11 | { 12 | public class FakeExtensionBase : IConcordionExtension, IDocumentParsingListener 13 | { 14 | public static readonly String FakeExtensionAttrName = "fake.extensions"; 15 | private readonly string m_Text; 16 | 17 | public FakeExtensionBase() { 18 | this.m_Text = this.GetType().Name; 19 | } 20 | 21 | public FakeExtensionBase(string text) { 22 | this.m_Text = text; 23 | } 24 | 25 | public void BeforeParsing(XDocument document) 26 | { 27 | var rootElement = new Element(document.Root); 28 | var existingValue = rootElement.GetAttributeValue(FakeExtensionAttrName); 29 | var newValue = this.m_Text; 30 | if (existingValue != null) { 31 | newValue = existingValue + ", " + newValue; 32 | } 33 | rootElement.AddAttribute(FakeExtensionAttrName, newValue); 34 | } 35 | 36 | public void AddTo(IConcordionExtender concordionExtender) 37 | { 38 | concordionExtender.WithDocumentParsingListener(this); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Extension/Css/CssEmbeddedExtension.cs: -------------------------------------------------------------------------------- 1 | using Concordion.Api.Extension; 2 | 3 | namespace Concordion.Spec.Concordion.Extension.Css 4 | { 5 | public class CssEmbeddedExtension : IConcordionExtension 6 | { 7 | public void AddTo(IConcordionExtender concordionExtender) 8 | { 9 | concordionExtender.WithEmbeddedCss(CssExtensionTest.TestCss); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Extension/Css/CssExtensionTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Concordion.Api; 3 | using Concordion.Integration; 4 | 5 | namespace Concordion.Spec.Concordion.Extension.Css 6 | { 7 | [ConcordionTest] 8 | public class CssExtensionTest : AbstractExtensionTestCase 9 | { 10 | public static readonly string SourcePath = "/test/concordion/my.css"; 11 | public static readonly string TestCss = "/* My test CSS */"; 12 | 13 | public void addLinkedCSSExtension() 14 | { 15 | this.Extension = new CssLinkedExtension(); 16 | } 17 | 18 | public void addEmbeddedCSSExtension() 19 | { 20 | this.Extension = new CssEmbeddedExtension(); 21 | } 22 | 23 | protected override void ConfigureTestRig() 24 | { 25 | this.TestRig.WithResource(new global::Concordion.Api.Resource(SourcePath), TestCss); 26 | } 27 | 28 | public bool hasCSSDeclaration(String cssFilename) 29 | { 30 | return this.ProcessingResult.HasCssDeclaration(cssFilename); 31 | } 32 | 33 | public bool hasEmbeddedTestCSS() 34 | { 35 | return this.ProcessingResult.HasEmbeddedCss(TestCss); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Extension/Css/CssLinkedExtension.cs: -------------------------------------------------------------------------------- 1 | using Concordion.Api; 2 | using Concordion.Api.Extension; 3 | 4 | namespace Concordion.Spec.Concordion.Extension.Css 5 | { 6 | public class CssLinkedExtension : IConcordionExtension 7 | { 8 | public void AddTo(IConcordionExtender concordionExtender) 9 | { 10 | concordionExtender.WithLinkedCss( 11 | CssExtensionTest.SourcePath, 12 | new global::Concordion.Api.Resource("/css/my.css")); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Extension/ExtensionTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Concordion.Integration; 5 | 6 | namespace Concordion.Spec.Concordion.Extension 7 | { 8 | [ConcordionTest] 9 | public class ExtensionTest 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Extension/FileSuffix/FileSuffixExtensionsTest.cs: -------------------------------------------------------------------------------- 1 | using Concordion.Api.Extension; 2 | using Concordion.Integration; 3 | 4 | namespace Concordion.Spec.Concordion.Extension.FileSuffix 5 | { 6 | [ConcordionTest] 7 | [Extensions(typeof(XhtmlExtension))] 8 | public class FileSuffixExtensionsTest 9 | { 10 | public bool hasBeenProcessed() 11 | { 12 | return true; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Extension/FileSuffix/XhtmlExtension.cs: -------------------------------------------------------------------------------- 1 | using Concordion.Api.Extension; 2 | using Concordion.Internal; 3 | 4 | namespace Concordion.Spec.Concordion.Extension.FileSuffix 5 | { 6 | public class XhtmlExtension : IConcordionExtension 7 | { 8 | public void AddTo(IConcordionExtender concordionExtender) 9 | { 10 | concordionExtender 11 | .WithSpecificationLocator(new ClassNameBasedSpecificationLocator("xhtml")); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Extension/JavaScript/JavaScriptEmbeddedExtension.cs: -------------------------------------------------------------------------------- 1 | using Concordion.Api.Extension; 2 | 3 | namespace Concordion.Spec.Concordion.Extension.JavaScript 4 | { 5 | public class JavaScriptEmbeddedExtension : IConcordionExtension 6 | { 7 | public void AddTo(IConcordionExtender concordionExtender) 8 | { 9 | concordionExtender.WithEmbeddedJavaScript(JavaScriptExtensionTest.TestJs); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Extension/JavaScript/JavaScriptExtensionTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Concordion.Api; 3 | using Concordion.Integration; 4 | 5 | namespace Concordion.Spec.Concordion.Extension.JavaScript 6 | { 7 | [ConcordionTest] 8 | public class JavaScriptExtensionTest : AbstractExtensionTestCase 9 | { 10 | public static readonly String SourcePath = "/test/concordion/my.js"; 11 | public static readonly String TestJs = "/* My test JS */"; 12 | 13 | public void addLinkedJavaScriptExtension() 14 | { 15 | this.Extension = new JavaScriptLinkedExtension(); 16 | } 17 | 18 | public void addEmbeddedJavaScriptExtension() 19 | { 20 | this.Extension = new JavaScriptEmbeddedExtension(); 21 | } 22 | 23 | protected override void ConfigureTestRig() 24 | { 25 | this.TestRig.WithResource(new global::Concordion.Api.Resource(SourcePath), TestJs); 26 | } 27 | 28 | public bool hasJavaScriptDeclaration(string cssFilename) 29 | { 30 | return this.ProcessingResult.HasJavaScriptDeclaration(cssFilename); 31 | } 32 | 33 | public bool hasEmbeddedTestJavaScript() 34 | { 35 | return this.ProcessingResult.HasEmbeddedJavaScript(TestJs); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Extension/JavaScript/JavaScriptLinkedExtension.cs: -------------------------------------------------------------------------------- 1 | using Concordion.Api; 2 | using Concordion.Api.Extension; 3 | 4 | namespace Concordion.Spec.Concordion.Extension.JavaScript 5 | { 6 | class JavaScriptLinkedExtension : IConcordionExtension 7 | { 8 | public void AddTo(IConcordionExtender concordionExtender) 9 | { 10 | concordionExtender.WithLinkedJavaScript( 11 | JavaScriptExtensionTest.SourcePath, 12 | new global::Concordion.Api.Resource("/js/my.js")); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Extension/Listener/AssertLogger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using Concordion.Api.Listener; 6 | 7 | namespace Concordion.Spec.Concordion.Extension.Listener 8 | { 9 | public class AssertLogger : IAssertEqualsListener, IAssertTrueListener, IAssertFalseListener 10 | { 11 | private readonly TextWriter m_LogWriter; 12 | 13 | public AssertLogger(TextWriter logWriter) 14 | { 15 | this.m_LogWriter = logWriter; 16 | } 17 | 18 | public void SuccessReported(AssertSuccessEvent successEvent) 19 | { 20 | m_LogWriter.WriteLine("Success '{0}'", successEvent.Element.Text); 21 | } 22 | 23 | public void FailureReported(AssertFailureEvent failureEvent) 24 | { 25 | m_LogWriter.WriteLine("Failure expected:'{0}' actual:'{1}'", failureEvent.Expected, failureEvent.Actual); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Extension/Listener/ExecuteTableListenerTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Globalization; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading; 7 | using Concordion.Integration; 8 | 9 | namespace Concordion.Spec.Concordion.Extension.Listener 10 | { 11 | [ConcordionTest] 12 | public class ExecuteTableListenerTest : AbstractExtensionTestCase 13 | { 14 | public void addLoggingExtension() 15 | { 16 | Extension = new LoggingExtension(LogWriter); 17 | } 18 | 19 | public string sqrt(string num) 20 | { 21 | Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; 22 | return Math.Sqrt(Convert.ToDouble(num)).ToString("N1"); 23 | } 24 | 25 | public string generateUsername(string fullName) 26 | { 27 | return fullName.Replace(" ", "").ToLower(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Extension/Listener/ListenerTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Globalization; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading; 7 | using Concordion.Integration; 8 | 9 | namespace Concordion.Spec.Concordion.Extension.Listener 10 | { 11 | [ConcordionTest] 12 | public class ListenerTest : AbstractExtensionTestCase 13 | { 14 | public void addLoggingExtension() 15 | { 16 | Extension = new LoggingExtension(LogWriter); 17 | } 18 | 19 | public string sqrt(string num) 20 | { 21 | Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; 22 | return Math.Sqrt(Convert.ToDouble(num)).ToString("N1"); 23 | } 24 | 25 | public bool isPositive(int num) 26 | { 27 | return num > 0; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Extension/Listener/LoggingExtension.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using Concordion.Api.Extension; 7 | 8 | namespace Concordion.Spec.Concordion.Extension.Listener 9 | { 10 | public class LoggingExtension : IConcordionExtension 11 | { 12 | private readonly AssertLogger m_AssertLogger; 13 | 14 | private readonly ExecuteLogger m_ExecuteLogger; 15 | 16 | private readonly VerifyRowsLogger m_VerifyRowsLogger; 17 | 18 | public LoggingExtension(TextWriter logWriter) 19 | { 20 | this.m_AssertLogger = new AssertLogger(logWriter); 21 | this.m_ExecuteLogger = new ExecuteLogger(logWriter); 22 | this.m_VerifyRowsLogger = new VerifyRowsLogger(logWriter); 23 | } 24 | 25 | public void AddTo(IConcordionExtender concordionExtender) 26 | { 27 | concordionExtender.WithAssertEqualsListener(m_AssertLogger); 28 | concordionExtender.WithAssertTrueListener(m_AssertLogger); 29 | concordionExtender.WithAssertFalseListener(m_AssertLogger); 30 | concordionExtender.WithExecuteListener(m_ExecuteLogger); 31 | concordionExtender.WithVerifyRowsListener(m_VerifyRowsLogger); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Extension/Listener/VerifyRowsListenerTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | 7 | namespace Concordion.Spec.Concordion.Extension.Listener 8 | { 9 | [ConcordionTest] 10 | public class VerifyRowsListenerTest : AbstractExtensionTestCase 11 | { 12 | public void addLoggingExtension() 13 | { 14 | Extension = new LoggingExtension(LogWriter); 15 | } 16 | 17 | public List getGeorgeAndRingo() 18 | { 19 | var result = new string[] {"George Harrison", "Ringo Starr"}; 20 | return result.ToList(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Extension/Listener/VerifyRowsLogger.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Concordion.Api.Listener; 3 | 4 | namespace Concordion.Spec.Concordion.Extension.Listener 5 | { 6 | public class VerifyRowsLogger : IVerifyRowsListener 7 | { 8 | #region Fields 9 | 10 | private readonly TextWriter m_LogWriter; 11 | 12 | #endregion 13 | 14 | #region IVerifyRowsListener Members 15 | 16 | public VerifyRowsLogger(TextWriter logWriter) 17 | { 18 | this.m_LogWriter = logWriter; 19 | } 20 | 21 | public void ExpressionEvaluated(ExpressionEvaluatedEvent expressionEvaluatedEvent) 22 | { 23 | this.m_LogWriter.WriteLine("Evaluated '{0}'", 24 | expressionEvaluatedEvent.Element.GetAttributeValue("verifyRows", HtmlFramework.NAMESPACE_CONCORDION_2007)); 25 | } 26 | 27 | public void MissingRow(MissingRowEvent missingRowEvent) 28 | { 29 | this.m_LogWriter.WriteLine("Missing Row '{0}'", missingRowEvent.RowElement.Text); 30 | } 31 | 32 | public void SurplusRow(SurplusRowEvent surplusRowEvent) 33 | { 34 | this.m_LogWriter.WriteLine("Surplus Row '{0}'", surplusRowEvent.RowElement.Text); 35 | } 36 | 37 | #endregion 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Extension/Resource/DynamicResourceExtension.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using Concordion.Api; 4 | using Concordion.Api.Extension; 5 | using Concordion.Api.Listener; 6 | 7 | namespace Concordion.Spec.Concordion.Extension.Resource 8 | { 9 | public class DynamicResourceExtension : IConcordionExtension, IConcordionBuildListener 10 | { 11 | public static readonly String SourcePath = "/test/concordion/o.png"; 12 | private ITarget m_Target; 13 | 14 | public void AddTo(IConcordionExtender concordionExtender) 15 | { 16 | concordionExtender.WithBuildListener(this); 17 | } 18 | 19 | public void ConcordionBuilt(ConcordionBuildEvent buildEvent) 20 | { 21 | this.m_Target = buildEvent.Target; 22 | 23 | this.CreateResourceInTarget(); // NOTE: normally this would be done during specification processing - eg in an AssertEqualsListener 24 | } 25 | 26 | private void CreateResourceInTarget() 27 | { 28 | this.m_Target.CopyTo(new global::Concordion.Api.Resource("/resource/my.txt"), new StringReader("success")); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Extension/Resource/ResourceExtension.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Concordion.Api.Extension; 3 | 4 | namespace Concordion.Spec.Concordion.Extension.Resource 5 | { 6 | public class ResourceExtension : IConcordionExtension 7 | { 8 | public static readonly String SourcePath = "/test/concordion/o.png"; 9 | 10 | public void AddTo(IConcordionExtender concordionExtender) 11 | { 12 | concordionExtender.WithResource( 13 | SourcePath, 14 | new global::Concordion.Api.Resource(("/images/o.png"))); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Extension/Resource/ResourceExtensionTest.cs: -------------------------------------------------------------------------------- 1 | using Concordion.Integration; 2 | 3 | namespace Concordion.Spec.Concordion.Extension.Resource 4 | { 5 | [ConcordionTest] 6 | public class ResourceExtensionTest : AbstractExtensionTestCase 7 | { 8 | public void addResourceExtension() 9 | { 10 | Extension = new ResourceExtension(); 11 | } 12 | 13 | public void addDynamicResourceExtension() 14 | { 15 | Extension = new DynamicResourceExtension(); 16 | } 17 | 18 | protected override void ConfigureTestRig() 19 | { 20 | TestRig.WithResource(new Api.Resource(ResourceExtension.SourcePath), "0101"); 21 | } 22 | 23 | public int getMeaningOfLife() 24 | { 25 | return 42; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Integration/ConstructorTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | 7 | namespace Concordion.Spec.Concordion.Integration 8 | { 9 | [ConcordionTest] 10 | public class ConstructorTest 11 | { 12 | public static int ConstructorCallCount { get; set; } 13 | 14 | public ConstructorTest() 15 | { 16 | ConstructorCallCount++; 17 | } 18 | 19 | public void ResetCounter() 20 | { 21 | ConstructorCallCount = 0; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Integration/IntegrationTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Concordion.Integration; 5 | 6 | namespace Concordion.Spec.Concordion.Integration 7 | { 8 | [ConcordionTest] 9 | public class IntegrationTest 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Integration/NUnitRunnerTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Concordion.Runners.NUnit; 4 | using Concordion.Spec.Support; 5 | using NUnit.Framework; 6 | 7 | namespace Concordion.Spec.Concordion.Integration 8 | { 9 | [TestFixture] 10 | public class NUnitRunnerTest : Runners.NUnit.ExecutableSpecification 11 | { 12 | public bool GreetingsProcessed(string fragment) 13 | { 14 | return new TestRig() 15 | .WithFixture(this) 16 | .ProcessFragment(fragment) 17 | .IsSuccess; 18 | } 19 | 20 | public string GetGreeting() 21 | { 22 | return new Greeter().GetMessage(); 23 | } 24 | } 25 | 26 | public class Greeter 27 | { 28 | public string GetMessage() 29 | { 30 | return "Hello World!"; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Integration/SetupMethodTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | using NUnit.Framework; 7 | 8 | namespace Concordion.Spec.Concordion.Integration 9 | { 10 | [ConcordionTest] 11 | public class SetupMethodTest 12 | { 13 | private List m_CalledMethods; 14 | private List CalledMethods 15 | { 16 | get 17 | { 18 | if (m_CalledMethods == null) 19 | { 20 | m_CalledMethods = new List(); 21 | } 22 | return m_CalledMethods; 23 | } 24 | } 25 | 26 | [TestFixtureSetUp] 27 | public void Setup1() 28 | { 29 | CalledMethods.Add("Setup1"); 30 | } 31 | 32 | [TestFixtureSetUp] 33 | public void Setup2() 34 | { 35 | CalledMethods.Add("Setup2"); 36 | } 37 | 38 | public bool SetupMethodsCalled() 39 | { 40 | if (CalledMethods.Count == 2 && 41 | (CalledMethods.Contains("Setup1") && CalledMethods.Contains("Setup2"))) 42 | { 43 | return true; 44 | } 45 | return false; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Results/AssertEquals/Failure/AnchorsTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | 7 | namespace Concordion.Spec.Concordion.Results.AssertEquals.Failure 8 | { 9 | [ConcordionTest] 10 | public class AnchorsTest 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Results/AssertEquals/Failure/EmptyFailureTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | 7 | namespace Concordion.Spec.Concordion.Results.AssertEquals.Failure 8 | { 9 | [ConcordionTest] 10 | public class EmptyFailureTest : FailureTest 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Results/AssertEquals/Failure/FailureTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | using Concordion.Spec.Support; 7 | 8 | namespace Concordion.Spec.Concordion.Results.AssertEquals.Failure 9 | { 10 | [ConcordionTest] 11 | public class FailureTest 12 | { 13 | public string acronym; 14 | 15 | public string renderAsFailure(string fragment, string acronym) 16 | { 17 | this.acronym = acronym; 18 | return new TestRig() 19 | .WithFixture(this) 20 | .ProcessFragment(fragment) 21 | .GetOutputFragmentXML() 22 | .Replace("\u00A0", " "); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Results/AssertEquals/Failure/NestedElementsTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | using Concordion.Spec.Support; 7 | 8 | namespace Concordion.Spec.Concordion.Results.AssertEquals.Failure 9 | { 10 | [ConcordionTest] 11 | public class NestedElementsTest : FailureTest 12 | { 13 | public string matchOrNotMatch(string snippet, string evaluationResult) 14 | { 15 | return new TestRig() 16 | .WithStubbedEvaluationResult(evaluationResult) 17 | .ProcessFragment(snippet) 18 | .HasFailures ? "not match" : "match"; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Results/AssertEquals/Success/EmptySuccessTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | 7 | namespace Concordion.Spec.Concordion.Results.AssertEquals.Success 8 | { 9 | [ConcordionTest] 10 | public class EmptySuccessTest : SuccessTest 11 | { 12 | public EmptySuccessTest() 13 | { 14 | username = String.Empty; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Results/AssertEquals/Success/HasAttributesTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | 7 | namespace Concordion.Spec.Concordion.Results.AssertEquals.Success 8 | { 9 | [ConcordionTest] 10 | public class HasAttributesTest : SuccessTest 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Results/AssertEquals/Success/HasClassAttributeTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | 7 | namespace Concordion.Spec.Concordion.Results.AssertEquals.Success 8 | { 9 | [ConcordionTest] 10 | public class HasClassAttributeTest : SuccessTest 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Results/AssertEquals/Success/SuccessTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | using Concordion.Spec.Support; 7 | 8 | namespace Concordion.Spec.Concordion.Results.AssertEquals.Success 9 | { 10 | [ConcordionTest] 11 | public class SuccessTest 12 | { 13 | public string username = "fred"; 14 | 15 | public string renderAsSuccess(string fragment) 16 | { 17 | return new TestRig() 18 | .WithFixture(this) 19 | .ProcessFragment(fragment) 20 | .GetOutputFragmentXML() 21 | .Replace("\u00A0", " "); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Results/AssertFalse/Failure/OnFailureTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | using Concordion.Spec.Support; 7 | 8 | namespace Concordion.Spec.Concordion.Results.AssertFalse.Failure 9 | { 10 | [ConcordionTest] 11 | public class OnFailureTest 12 | { 13 | public bool isPalindrome(string s) 14 | { 15 | return s == Reverse(s); 16 | } 17 | 18 | private string Reverse(string s) 19 | { 20 | var builder = new StringBuilder(); 21 | 22 | for (int index = s.Length - 1; index >= 0; index--) 23 | { 24 | builder.Append(s[index]); 25 | } 26 | 27 | return builder.ToString(); 28 | } 29 | 30 | public string render(string fragment) 31 | { 32 | return new TestRig() 33 | .WithFixture(this) 34 | .ProcessFragment(fragment) 35 | .GetOutputFragmentXML(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Results/AssertFalse/Success/OnSuccessTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | using Concordion.Spec.Support; 7 | 8 | namespace Concordion.Spec.Concordion.Results.AssertFalse.Success 9 | { 10 | [ConcordionTest] 11 | public class OnSuccessTest 12 | { 13 | public bool isPalindrome(string s) 14 | { 15 | return s == Reverse(s); 16 | } 17 | 18 | private string Reverse(string s) 19 | { 20 | var builder = new StringBuilder(); 21 | 22 | for (int index = s.Length - 1; index >= 0; index--) 23 | { 24 | builder.Append(s[index]); 25 | } 26 | 27 | return builder.ToString(); 28 | } 29 | 30 | public string render(string fragment) 31 | { 32 | return new TestRig() 33 | .WithFixture(this) 34 | .ProcessFragment(fragment) 35 | .GetOutputFragmentXML(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Results/AssertTrue/Failure/FailureTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | using Concordion.Spec.Support; 7 | 8 | namespace Concordion.Spec.Concordion.Results.AssertTrue.Failure 9 | { 10 | [ConcordionTest] 11 | public class FailureTest 12 | { 13 | public bool isPalindrome(string s) 14 | { 15 | return s == Reverse(s); 16 | } 17 | 18 | private string Reverse(string s) 19 | { 20 | var builder = new StringBuilder(); 21 | 22 | for (int index = s.Length - 1; index >= 0; index--) 23 | { 24 | builder.Append(s[index]); 25 | } 26 | 27 | return builder.ToString(); 28 | } 29 | 30 | public string render(string fragment) 31 | { 32 | return new TestRig() 33 | .WithFixture(this) 34 | .ProcessFragment(fragment) 35 | .GetOutputFragmentXML(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Results/AssertTrue/Success/SuccessTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | using Concordion.Spec.Support; 7 | 8 | namespace Concordion.Spec.Concordion.Results.AssertTrue.Success 9 | { 10 | [ConcordionTest] 11 | public class SuccessTest 12 | { 13 | public bool isPalindrome(string s) 14 | { 15 | return s == Reverse(s); 16 | } 17 | 18 | private string Reverse(string s) 19 | { 20 | var builder = new StringBuilder(); 21 | 22 | for (int index = s.Length - 1; index >= 0; index--) 23 | { 24 | builder.Append(s[index]); 25 | } 26 | 27 | return builder.ToString(); 28 | } 29 | 30 | public string render(string fragment) 31 | { 32 | return new TestRig() 33 | .WithFixture(this) 34 | .ProcessFragment(fragment) 35 | .GetOutputFragmentXML(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Results/Breadcrumbs/AbstractBreadcrumbsTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Api; 6 | using System.Xml.Linq; 7 | using Concordion.Spec.Support; 8 | 9 | namespace Concordion.Spec.Concordion.Results.Breadcrumbs 10 | { 11 | public abstract class AbstractBreadcrumbsTest 12 | { 13 | private TestRig testRig = new TestRig(); 14 | 15 | public virtual void setUpResource(string resourceName, string content) 16 | { 17 | testRig.WithResource(new Resource(resourceName), content); 18 | } 19 | 20 | public virtual Result getBreadcrumbsFor(string resourceName) 21 | { 22 | var spanElements = testRig 23 | .Process(new Resource(resourceName)) 24 | .GetXDocument() 25 | .Root 26 | .Descendants("span"); 27 | 28 | Result result = new Result(); 29 | foreach (var span in spanElements) 30 | { 31 | if ("breadcrumbs" == span.Attribute("class").Value) 32 | { 33 | result.html = span.ToString(SaveOptions.DisableFormatting); 34 | result.text = span.Value; 35 | } 36 | } 37 | return result; 38 | } 39 | 40 | public class Result 41 | { 42 | public String text = ""; 43 | public String html = ""; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Results/Breadcrumbs/BreadcrumbsTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | 7 | namespace Concordion.Spec.Concordion.Results.Breadcrumbs 8 | { 9 | [ConcordionTest] 10 | public class BreadcrumbsTest : AbstractBreadcrumbsTest 11 | { 12 | public override void setUpResource(string resourceName, string content) 13 | { 14 | base.setUpResource(resourceName, content); 15 | } 16 | 17 | public override Result getBreadcrumbsFor(string resourceName) 18 | { 19 | return base.getBreadcrumbsFor(resourceName); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Results/Breadcrumbs/DeterminingBreadcrumbsTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | 7 | namespace Concordion.Spec.Concordion.Results.Breadcrumbs 8 | { 9 | [ConcordionTest] 10 | public class DeterminingBreadcrumbsTest : AbstractBreadcrumbsTest 11 | { 12 | public string getBreadcrumbTextFor(string resourceName) 13 | { 14 | return base.getBreadcrumbsFor(resourceName).text; 15 | } 16 | 17 | public void setUpResource(string resourceName) 18 | { 19 | base.setUpResource(resourceName, ""); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Results/Breadcrumbs/WordingTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Text.RegularExpressions; 6 | using Concordion.Integration; 7 | 8 | namespace Concordion.Spec.Concordion.Results.Breadcrumbs 9 | { 10 | [ConcordionTest] 11 | public class WordingTest : AbstractBreadcrumbsTest 12 | { 13 | public string getBreadcrumbWordingFor(string resourceName, string content) 14 | { 15 | string packageName = "/" + resourceName.Replace(".html", String.Empty) + "/"; 16 | string otherResourceName = "Demo.html"; 17 | setUpResource(packageName + resourceName, content); 18 | setUpResource(packageName + otherResourceName, ""); 19 | var breadcrumbs = getBreadcrumbsFor(packageName + otherResourceName).text; 20 | return Regex.Replace(breadcrumbs, " *> *", String.Empty); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Concordion.Spec/Concordion/Results/ResultsTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | 7 | namespace Concordion.Spec.Concordion.Results 8 | { 9 | [ConcordionTest] 10 | public class ResultsTest 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Concordion.Spec/Examples/DemoTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | 7 | namespace Concordion.Spec.Examples 8 | { 9 | [ConcordionTest] 10 | public class DemoTest 11 | { 12 | public string greetingFor(string firstName) 13 | { 14 | return string.Format("Hello {0}!", firstName); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Concordion.Spec/Examples/PartialMatchesTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | 7 | namespace Concordion.Spec.Examples 8 | { 9 | [ConcordionTest] 10 | public class PartialMatchesTest 11 | { 12 | private List usernamesInSystem = new List(); 13 | 14 | public void setUpUser(string username) 15 | { 16 | usernamesInSystem.Add(username); 17 | } 18 | 19 | public List getSearchResultsFor(string searchString) 20 | { 21 | var matchSet = new List(); 22 | 23 | var matches = from username in usernamesInSystem 24 | where username.Contains(searchString) 25 | select username; 26 | 27 | foreach (string match in matches) 28 | { 29 | matchSet.Add(match); 30 | } 31 | 32 | return matchSet; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Concordion.Spec/Examples/SpikeTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Integration; 6 | 7 | namespace Concordion.Spec.Examples 8 | { 9 | [ConcordionTest] 10 | public class SpikeTest 11 | { 12 | public string getGreetingFor(string name) 13 | { 14 | return "Hello " + name + "!"; 15 | } 16 | 17 | public void doSomething() 18 | { 19 | } 20 | 21 | public ICollection getPeople() 22 | { 23 | return new List { new Person("John", "Travolta") }; 24 | } 25 | 26 | public class Person 27 | { 28 | public Person(string firstName, string lastName) 29 | { 30 | this.FirstName = firstName; 31 | this.LastName = lastName; 32 | } 33 | 34 | public string FirstName; 35 | public string LastName; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Concordion.Spec/Support/EventRecorder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Concordion.Api.Listener; 5 | 6 | namespace Concordion.Spec.Support 7 | { 8 | public class EventRecorder : IAssertEqualsListener, IExceptionCaughtListener 9 | { 10 | private readonly List m_Events; 11 | 12 | public EventRecorder() 13 | { 14 | this.m_Events = new List(); 15 | } 16 | 17 | public Object GetLast(Type eventType) 18 | { 19 | Object lastMatch = null; 20 | foreach (var anEvent in this.m_Events.Where(eventType.IsInstanceOfType)) 21 | { 22 | lastMatch = anEvent; 23 | } 24 | return lastMatch; 25 | } 26 | 27 | public void ExceptionCaught(ExceptionCaughtEvent caughtEvent) 28 | { 29 | this.m_Events.Add(caughtEvent); 30 | } 31 | 32 | #region IAssertEqualsListener Members 33 | 34 | public void SuccessReported(AssertSuccessEvent successEvent) 35 | { 36 | this.m_Events.Add(successEvent); 37 | } 38 | 39 | public void FailureReported(AssertFailureEvent failureEvent) 40 | { 41 | this.m_Events.Add(failureEvent); 42 | } 43 | 44 | #endregion 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Concordion.Spec/Support/StackTraceSettingException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Diagnostics; 6 | 7 | namespace Concordion.Spec.Support 8 | { 9 | internal class StackTraceSettingException : Exception 10 | { 11 | public List StackTraceElements 12 | { 13 | get; 14 | set; 15 | } 16 | 17 | public override string StackTrace 18 | { 19 | get 20 | { 21 | var builder = new StringBuilder(); 22 | foreach (var element in StackTraceElements) 23 | { 24 | builder.AppendLine(element); 25 | } 26 | return builder.ToString(); 27 | } 28 | 29 | } 30 | 31 | public StackTraceSettingException() 32 | : base() 33 | { 34 | StackTraceElements = new List(); 35 | } 36 | 37 | public StackTraceSettingException(string message) 38 | : base(message) 39 | { 40 | StackTraceElements = new List(); 41 | } 42 | 43 | public StackTraceSettingException(string message, Exception inner) 44 | : base(message, inner) 45 | { 46 | StackTraceElements = new List(); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Concordion.Spec/Support/StubEvaluator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Concordion.Api; 5 | 6 | namespace Concordion.Spec.Support 7 | { 8 | public class StubEvaluator : IEvaluator, IEvaluatorFactory 9 | { 10 | private object evaluationResult = null; 11 | 12 | public StubEvaluator(object fixture) 13 | { 14 | this.Fixture = fixture; 15 | } 16 | 17 | public IEvaluator CreateEvaluator(object fixture) 18 | { 19 | return this; 20 | } 21 | 22 | public object Evaluate(string expression) 23 | { 24 | if (this.evaluationResult is Exception) 25 | { 26 | throw (Exception) this.evaluationResult; 27 | } 28 | return this.evaluationResult; 29 | } 30 | 31 | public object GetVariable(string variableName) 32 | { 33 | return null; 34 | } 35 | 36 | public void SetVariable(string variableName, object value) 37 | { 38 | } 39 | 40 | public object Fixture 41 | { 42 | get; 43 | private set; 44 | } 45 | 46 | public IEvaluatorFactory withStubbedResult(object evaluationResult) 47 | { 48 | this.evaluationResult = evaluationResult; 49 | return this; 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /Concordion.Test/Integration/FileTarget_Fixture.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using NUnit.Framework; 6 | using Moq; 7 | using Concordion.Api; 8 | using Concordion.Internal; 9 | 10 | namespace Concordion.Test.Integration 11 | { 12 | [TestFixture] 13 | public class FileTarget_Fixture 14 | { 15 | [Test] 16 | public void Test_Can_Get_File_Path_Successfully() 17 | { 18 | var resource = new Mock("blah\\blah.txt"); 19 | resource.Expect(x => x.Path).Returns("blah\\blah.txt"); 20 | 21 | var target = new FileTarget(@"c:\temp"); 22 | 23 | Assert.AreEqual(@"c:\temp\blah\blah.txt", target.GetTargetPath(resource.Object)); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Concordion.Test/Internal/DummyContainingTestInNameTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Concordion.Test.Internal 7 | { 8 | class DummyContainingTestInNameTest 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Concordion.Test/Internal/SpecificationLocatorTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using Concordion.Api; 7 | using Concordion.Internal; 8 | using NUnit.Framework; 9 | 10 | namespace Concordion.Test.Internal 11 | { 12 | [TestFixture] 13 | public class SpecificationLocatorTest 14 | { 15 | [Test] 16 | public void ShouldRemoveTestSuffixes() 17 | { 18 | var specificationLocator = new ClassNameBasedSpecificationLocator(); 19 | var resource = specificationLocator.LocateSpecification(this); 20 | var path = resource.Path.Replace(Path.DirectorySeparatorChar, '/'); 21 | Assert.AreEqual("Concordion/Test/Internal/SpecificationLocator.html", path, "path from SpecificationLocator contains 'Test'"); 22 | } 23 | 24 | [Test] 25 | public void ShouldNotRemoreWordTestInBetween() 26 | { 27 | var specificationLocator = new ClassNameBasedSpecificationLocator(); 28 | var resource = specificationLocator.LocateSpecification(new DummyContainingTestInNameTest()); 29 | var path = resource.Path.Replace(Path.DirectorySeparatorChar, '/'); 30 | Assert.AreEqual("Concordion/Test/Internal/DummyContainingTestInName.html", path, "path from SpecificiationLocator removed 'Test' in the middle"); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Concordion.Test/Listener/JavaScriptLinkerTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Xml.Linq; 6 | using Concordion.Api; 7 | using Concordion.Test.Support; 8 | using NUnit.Framework; 9 | using Concordion.Internal.Listener; 10 | 11 | namespace Concordion.Test.Listener 12 | { 13 | [TestFixture] 14 | public class JavaScriptLinkerTest 15 | { 16 | private static readonly Resource NOT_NEEDED_PARAMETER = null; 17 | 18 | [Test] 19 | public void XmlOutputContainsAnExplicitEndTagForScriptElement() 20 | { 21 | var javaScriptLinker = new JavaScriptLinker(NOT_NEEDED_PARAMETER); 22 | 23 | var html = new XElement("html"); 24 | var head = new XElement("head"); 25 | html.Add(head); 26 | 27 | javaScriptLinker.BeforeParsing(new XDocument(html)); 28 | 29 | var expected = ""; 30 | var actual = new HtmlUtil().RemoveWhitespaceBetweenTags(head.ToString()); 31 | Assert.AreEqual(expected, actual); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Concordion.Test/Support/HtmlUtil.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Text.RegularExpressions; 6 | 7 | namespace Concordion.Test.Support 8 | { 9 | public class HtmlUtil 10 | { 11 | public string RemoveWhitespaceBetweenTags(string inputString) 12 | { 13 | return Regex.Replace(inputString, ">[\r\n ]*<", "><"); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Concordion.Test/TestObject/DemoTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Concordion.Test 7 | { 8 | public class DemoTest 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Concordion.vsmdi: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Concordion/Api/AbstractCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Internal; 6 | 7 | namespace Concordion.Api 8 | { 9 | public abstract class AbstractCommand : ICommand 10 | { 11 | virtual public void Setup(CommandCall commandCall, IEvaluator evaluator, IResultRecorder resultRecorder) 12 | { 13 | } 14 | 15 | virtual public void Execute(CommandCall commandCall, IEvaluator evaluator, IResultRecorder resultRecorder) 16 | { 17 | } 18 | 19 | virtual public void Verify(CommandCall commandCall, IEvaluator evaluator, IResultRecorder resultRecorder) 20 | { 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Concordion/Api/ExpectedToFailAttribute.cs: -------------------------------------------------------------------------------- 1 | // you may not use this file except in compliance with the License. 2 | // You may obtain a copy of the License at 3 | // 4 | // http://www.apache.org/licenses/LICENSE-2.0 5 | // 6 | // Unless required by applicable law or agreed to in writing, software 7 | // distributed under the License is distributed on an "AS IS" BASIS, 8 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | // See the License for the specific language governing permissions and 10 | // limitations under the License. 11 | 12 | using System; 13 | using System.Collections.Generic; 14 | using System.Linq; 15 | using System.Text; 16 | 17 | namespace Concordion.Api 18 | { 19 | /// 20 | /// Indicates to Concordion that a fixture is expected to fail all assertions 21 | /// 22 | [AttributeUsage(AttributeTargets.Class)] 23 | public class ExpectedToFailAttribute : Attribute 24 | { 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Concordion/Api/ExpectedToPassAttribute.cs: -------------------------------------------------------------------------------- 1 | // you may not use this file except in compliance with the License. 2 | // You may obtain a copy of the License at 3 | // 4 | // http://www.apache.org/licenses/LICENSE-2.0 5 | // 6 | // Unless required by applicable law or agreed to in writing, software 7 | // distributed under the License is distributed on an "AS IS" BASIS, 8 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | // See the License for the specific language governing permissions and 10 | // limitations under the License. 11 | 12 | using System; 13 | using System.Collections.Generic; 14 | using System.Linq; 15 | using System.Text; 16 | 17 | namespace Concordion.Api 18 | { 19 | /// 20 | /// Indicates to Concordion that a class is expected to pass all assertions 21 | /// 22 | [AttributeUsage(AttributeTargets.Class)] 23 | public class ExpectedToPassAttribute : Attribute 24 | { 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Concordion/Api/Extension/ExtensionAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Concordion.Api.Extension 7 | { 8 | [AttributeUsage(AttributeTargets.Field)] 9 | public class ExtensionAttribute : Attribute 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Concordion/Api/Extension/ExtensionsAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Concordion.Api.Extension 7 | { 8 | [AttributeUsage(AttributeTargets.Class)] 9 | public class ExtensionsAttribute : Attribute 10 | { 11 | public Type[] ExtensionTypes { get; set; } 12 | 13 | public ExtensionsAttribute(params Type[] extensionTypes) 14 | { 15 | this.ExtensionTypes = extensionTypes; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Concordion/Api/Extension/IConcordionExtension.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Concordion.Api.Extension 7 | { 8 | /** 9 | * 10 | * Supplements Concordion behaviour by adding new commands, listeners or output enhancements. 11 | *

12 | * To use extensions, set the system property concordion.extensions to a comma-separated list containing: 13 | *

    14 | *
  • the fully-qualified class name of extensions to be installed, and/or
  • 15 | *
  • the fully-qualified class name of extension factories that will create an extension.
  • 16 | *
17 | *

18 | * If an extension is specified, it will be instantiated by Concordion. 19 | *

20 | * All extensions and/or extension factories must be present on the classpath. 21 | * Extensions must implement . 22 | * Extension factories must implement 18 | *

19 | */ 20 | public interface IConcordionExtensionFactory 21 | { 22 | IConcordionExtension CreateExtension(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Concordion/Api/ICommandFactory.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2009 Jeffrey Cameron 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | 20 | namespace Concordion.Api 21 | { 22 | /// 23 | /// A factory to create command objects 24 | /// 25 | public interface ICommandFactory 26 | { 27 | /// 28 | /// Creates the command. 29 | /// 30 | /// The namespace URI. 31 | /// Name of the command. 32 | /// 33 | ICommand CreateCommand(string namespaceUri, string commandName); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Concordion/Api/IContext.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2009 Jeffrey Cameron 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | 20 | namespace Concordion.Api 21 | { 22 | /// 23 | /// 24 | /// 25 | public interface IContext : IResultRecorder, IEvaluator 26 | { 27 | Resource Resource { get; } 28 | Element Element { get; } 29 | string Expression { get; } 30 | object EvaluateExpression(); 31 | void ProcessChildCommandsSequentially(); 32 | bool HasChildCommands(); 33 | void SetupChildCommands(); 34 | void ExecuteChildCommands(); 35 | void VerifyChildCommands(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Concordion/Api/IEvaluatorFactory.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2009 Jeffrey Cameron 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | 20 | namespace Concordion.Api 21 | { 22 | /// 23 | /// Creates 24 | /// 25 | public interface IEvaluatorFactory 26 | { 27 | /// 28 | /// Creates the evaluator. 29 | /// 30 | /// The fixture. 31 | /// 32 | IEvaluator CreateEvaluator(object fixture); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Concordion/Api/IRunner.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2009 Jeffrey Cameron 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | 20 | namespace Concordion.Api 21 | { 22 | /// 23 | /// Runs concordion on a particular specification 24 | /// 25 | public interface IRunner 26 | { 27 | /// 28 | /// Executes the specified resource. 29 | /// 30 | /// The resource. 31 | /// The href. 32 | /// A result indicating how the specification ran. 33 | RunnerResult Execute(object fixture, Resource resource, string href); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Concordion/Api/ISpecification.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2009 Jeffrey Cameron 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | 20 | namespace Concordion.Api 21 | { 22 | /// 23 | /// An HTML specification that is input into Concordion 24 | /// 25 | public interface ISpecification 26 | { 27 | /// 28 | /// Processes the specification using the expression evaluator and writing the results to the result recorder 29 | /// 30 | /// The evaluator. 31 | /// The result recorder. 32 | void Process(IEvaluator evaluator, IResultRecorder resultRecorder); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Concordion/Api/ISpecificationLocator.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2009 Jeffrey Cameron 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | 20 | namespace Concordion.Api 21 | { 22 | /// 23 | /// Locates specifications for concordion 24 | /// 25 | public interface ISpecificationLocator 26 | { 27 | /// 28 | /// Locates the specification. 29 | /// 30 | /// The fixture. 31 | /// The resource representing where the specification is located, null otherwise. 32 | Resource LocateSpecification(object fixture); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Concordion/Api/ISpecificationReader.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2009 Jeffrey Cameron 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | 20 | namespace Concordion.Api 21 | { 22 | /// 23 | /// Parses and stores the specification at the location identified by the Resource object 24 | /// 25 | public interface ISpecificationReader 26 | { 27 | /// 28 | /// Reads the specification. 29 | /// 30 | /// The resource. 31 | /// 32 | ISpecification ReadSpecification(Resource resource); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Concordion/Api/Listener/AssertFailureEvent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Concordion.Api.Listener 7 | { 8 | public class AssertFailureEvent 9 | { 10 | #region Properties 11 | 12 | public Element Element 13 | { 14 | get; 15 | private set; 16 | } 17 | 18 | public string Expected 19 | { 20 | get; 21 | private set; 22 | } 23 | 24 | public object Actual 25 | { 26 | get; 27 | private set; 28 | } 29 | 30 | #endregion 31 | 32 | #region Constructors 33 | 34 | public AssertFailureEvent(Element element, string expected, object actual) { 35 | this.Element = element; 36 | this.Expected = expected; 37 | this.Actual = actual; 38 | } 39 | 40 | #endregion 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Concordion/Api/Listener/AssertSuccessEvent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Concordion.Api.Listener 7 | { 8 | public class AssertSuccessEvent 9 | { 10 | #region Properties 11 | 12 | public Element Element 13 | { 14 | get; 15 | private set; 16 | } 17 | 18 | #endregion 19 | 20 | #region Constructors 21 | 22 | public AssertSuccessEvent(Element element) { 23 | this.Element = element; 24 | } 25 | 26 | #endregion 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Concordion/Api/Listener/ConcordionBuildEvent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Concordion.Api.Listener 7 | { 8 | public class ConcordionBuildEvent 9 | { 10 | #region Properties 11 | 12 | public ITarget Target 13 | { 14 | get; 15 | private set; 16 | } 17 | 18 | #endregion 19 | 20 | #region Constructors 21 | 22 | public ConcordionBuildEvent(ITarget target) 23 | { 24 | this.Target = target; 25 | } 26 | 27 | #endregion 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Concordion/Api/Listener/ExceptionCaughtEvent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Concordion.Api.Listener 7 | { 8 | public class ExceptionCaughtEvent 9 | { 10 | #region Properties 11 | 12 | public Exception CaughtException 13 | { 14 | get; 15 | private set; 16 | } 17 | 18 | public Element Element 19 | { 20 | get; 21 | private set; 22 | } 23 | 24 | public string Expression 25 | { 26 | get; 27 | private set; 28 | } 29 | 30 | #endregion 31 | 32 | #region Constructors 33 | 34 | public ExceptionCaughtEvent(Exception exception, Element element, string expression) 35 | { 36 | this.CaughtException = exception; 37 | this.Element = element; 38 | this.Expression = expression; 39 | } 40 | 41 | #endregion 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Concordion/Api/Listener/ExecuteEvent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Concordion.Api.Listener 7 | { 8 | public class ExecuteEvent 9 | { 10 | #region Properties 11 | 12 | public Element Element { get; private set; } 13 | 14 | #endregion 15 | 16 | #region Constructors 17 | 18 | public ExecuteEvent(Element element) 19 | { 20 | this.Element = element; 21 | } 22 | 23 | #endregion 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Concordion/Api/Listener/ExpressionEvaluatedEvent.java.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Concordion.Api.Listener 7 | { 8 | public class ExpressionEvaluatedEvent 9 | { 10 | #region Properties 11 | 12 | public Element Element { get; private set; } 13 | 14 | #endregion 15 | 16 | #region Constructors 17 | 18 | public ExpressionEvaluatedEvent(Element rowElement) 19 | { 20 | this.Element = rowElement; 21 | } 22 | 23 | #endregion 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Concordion/Api/Listener/IAssertEqualsListener.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Concordion.Api.Listener 7 | { 8 | public interface IAssertEqualsListener : IAssertListener 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Concordion/Api/Listener/IAssertFalseListener.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Concordion.Api.Listener 7 | { 8 | public interface IAssertFalseListener : IAssertListener 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Concordion/Api/Listener/IAssertListener.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Concordion.Api.Listener 7 | { 8 | public interface IAssertListener 9 | { 10 | void SuccessReported(AssertSuccessEvent successEvent); 11 | 12 | void FailureReported(AssertFailureEvent failureEvent); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Concordion/Api/Listener/IAssertTrueListener.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Concordion.Api.Listener 7 | { 8 | public interface IAssertTrueListener : IAssertListener 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Concordion/Api/Listener/IConcordionBuildListener.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Concordion.Api.Listener 7 | { 8 | public interface IConcordionBuildListener 9 | { 10 | void ConcordionBuilt(ConcordionBuildEvent buildEvent); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Concordion/Api/Listener/IDocumentParsingListener.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Xml.Linq; 6 | 7 | namespace Concordion.Api.Listener 8 | { 9 | public interface IDocumentParsingListener 10 | { 11 | void BeforeParsing(XDocument document); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Concordion/Api/Listener/IExceptionCaughtListener.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Concordion.Api.Listener 7 | { 8 | public interface IExceptionCaughtListener 9 | { 10 | void ExceptionCaught(ExceptionCaughtEvent caughtEvent); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Concordion/Api/Listener/IExecuteListener.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace Concordion.Api.Listener 6 | { 7 | public interface IExecuteListener 8 | { 9 | void ExecuteCompleted(ExecuteEvent executeEvent); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Concordion/Api/Listener/IRunListener.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Concordion.Api.Listener 7 | { 8 | public interface IRunListener : IExceptionCaughtListener 9 | { 10 | void SuccessReported(RunSuccessEvent runSuccessEvent); 11 | 12 | void FailureReported(RunFailureEvent runFailureEvent); 13 | 14 | void IgnoredReported(RunIgnoreEvent runIgnoreEvent); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Concordion/Api/Listener/ISpecificationProcessingListener.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Concordion.Api.Listener 7 | { 8 | public interface ISpecificationProcessingListener 9 | { 10 | void BeforeProcessingSpecification(SpecificationProcessingEvent processingEvent); 11 | 12 | void AfterProcessingSpecification(SpecificationProcessingEvent processingEvent); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Concordion/Api/Listener/IVerifyRowsListener.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Concordion.Api.Listener 7 | { 8 | public interface IVerifyRowsListener 9 | { 10 | void ExpressionEvaluated(ExpressionEvaluatedEvent expressionEvaluatedEvent); 11 | 12 | void MissingRow(MissingRowEvent missingRowEvent); 13 | 14 | void SurplusRow(SurplusRowEvent surplusRowEvent); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Concordion/Api/Listener/MissingRowEvent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Concordion.Api.Listener 7 | { 8 | public class MissingRowEvent 9 | { 10 | #region Properties 11 | 12 | public Element RowElement { get; private set; } 13 | 14 | #endregion 15 | 16 | #region Constructors 17 | 18 | public MissingRowEvent(Element rowElement) 19 | { 20 | this.RowElement = rowElement; 21 | } 22 | 23 | #endregion 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Concordion/Api/Listener/RunFailureEvent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Concordion.Api.Listener 7 | { 8 | public class RunFailureEvent 9 | { 10 | #region Properties 11 | 12 | public Element Element { get; private set; } 13 | 14 | #endregion 15 | 16 | #region Constructors 17 | 18 | public RunFailureEvent(Element element) 19 | { 20 | this.Element = element; 21 | } 22 | 23 | #endregion 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Concordion/Api/Listener/RunIgnoreEvent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Concordion.Api.Listener 7 | { 8 | public class RunIgnoreEvent 9 | { 10 | #region Properties 11 | 12 | public Element Element { get; private set; } 13 | 14 | #endregion 15 | 16 | #region Constructors 17 | 18 | public RunIgnoreEvent(Element element) 19 | { 20 | this.Element = element; 21 | } 22 | 23 | #endregion 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Concordion/Api/Listener/RunSuccessEvent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Concordion.Api.Listener 7 | { 8 | public class RunSuccessEvent 9 | { 10 | #region Properties 11 | 12 | public Element Element { get; private set; } 13 | 14 | #endregion 15 | 16 | #region Constructors 17 | 18 | public RunSuccessEvent(Element element) 19 | { 20 | this.Element = element; 21 | } 22 | 23 | #endregion 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Concordion/Api/Listener/SpecificationProcessingEvent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Concordion.Api.Listener 7 | { 8 | public class SpecificationProcessingEvent 9 | { 10 | #region Properties 11 | 12 | public Element RootElement 13 | { 14 | get; 15 | private set; 16 | } 17 | 18 | public Resource Resource 19 | { 20 | get; 21 | private set; 22 | } 23 | 24 | #endregion 25 | 26 | #region Constructors 27 | 28 | public SpecificationProcessingEvent(Resource resource, Element rootElement) 29 | { 30 | this.Resource = resource; 31 | this.RootElement = rootElement; 32 | } 33 | 34 | #endregion 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Concordion/Api/Listener/SurplusRowEvent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Concordion.Api.Listener 7 | { 8 | public class SurplusRowEvent 9 | { 10 | #region Properties 11 | 12 | public Element RowElement { get; private set; } 13 | 14 | #endregion 15 | 16 | #region Constructors 17 | 18 | public SurplusRowEvent(Element rowElement) 19 | { 20 | this.RowElement = rowElement; 21 | } 22 | 23 | #endregion 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Concordion/Api/Result.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2009 Jeffrey Cameron 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | 20 | namespace Concordion.Api 21 | { 22 | /// 23 | /// 24 | /// 25 | public enum Result 26 | { 27 | /// 28 | /// Indicates a specification assertion was successful 29 | /// 30 | Success, 31 | 32 | /// 33 | /// Indicates a specification assertion was a failure 34 | /// 35 | Failure, 36 | 37 | /// 38 | /// Indicates a specification assertion had an exception 39 | /// 40 | Exception, 41 | 42 | /// 43 | /// Indicates a specification assertion was ignored 44 | /// 45 | Ignored 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Concordion/Api/ResultDetails.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Concordion.Api 7 | { 8 | /// 9 | /// 10 | /// 11 | public class ResultDetails 12 | { 13 | public Result Result { get; private set; } 14 | 15 | public string Message { get; private set; } 16 | 17 | public string StackTrace { get; private set; } 18 | 19 | public Exception Exception { get; private set; } 20 | 21 | public ResultDetails(Result result, string message, string stackTrace) 22 | { 23 | this.Result = result; 24 | this.Message = message; 25 | this.StackTrace = stackTrace; 26 | } 27 | 28 | public ResultDetails(Result result, Exception exception) 29 | { 30 | this.Result = result; 31 | this.Exception = exception; 32 | } 33 | 34 | public ResultDetails(Result result) 35 | { 36 | this.Result = result; 37 | } 38 | 39 | public bool IsSuccess 40 | { 41 | get { return this.Result == Result.Success; } 42 | } 43 | 44 | public bool IsFailure 45 | { 46 | get { return this.Result == Result.Failure; } 47 | } 48 | 49 | public bool IsError 50 | { 51 | get { return this.Result == Result.Exception; } 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Concordion/Api/UnimplementedAttribute.cs: -------------------------------------------------------------------------------- 1 | // you may not use this file except in compliance with the License. 2 | // You may obtain a copy of the License at 3 | // 4 | // http://www.apache.org/licenses/LICENSE-2.0 5 | // 6 | // Unless required by applicable law or agreed to in writing, software 7 | // distributed under the License is distributed on an "AS IS" BASIS, 8 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | // See the License for the specific language governing permissions and 10 | // limitations under the License. 11 | 12 | using System; 13 | using System.Collections.Generic; 14 | using System.Linq; 15 | using System.Text; 16 | 17 | namespace Concordion.Api 18 | { 19 | /// 20 | /// Indicates to Concordion if a Class is not yet implemented and should have no assertions 21 | /// 22 | [AttributeUsage(AttributeTargets.Class)] 23 | public class UnimplementedAttribute : Attribute 24 | { 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Concordion/Concordion.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Concordion/Integration/ConcordionAssemblyAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2009 Jeffrey Cameron 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | using System.IO; 20 | 21 | namespace Concordion.Integration 22 | { 23 | [AttributeUsage(AttributeTargets.Assembly)] 24 | public sealed class ConcordionAssemblyAttribute : Attribute 25 | { 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Concordion/Integration/ConcordionTestAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2009 Jeffrey Cameron 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using NUnit.Framework; 19 | 20 | namespace Concordion.Integration 21 | { 22 | [AttributeUsage(AttributeTargets.Class)] 23 | public class ConcordionTestAttribute : TestFixtureAttribute 24 | { 25 | public const string AttributeIdentifier = "Concordion.Integration.ConcordionTestAttribute"; 26 | 27 | public string Name 28 | { 29 | get; 30 | private set; 31 | } 32 | 33 | public string Path 34 | { 35 | get; 36 | private set; 37 | } 38 | 39 | public ConcordionTestAttribute() 40 | { 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Concordion/Internal/BooleanExpectationChecker.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Text.RegularExpressions; 6 | 7 | namespace Concordion.Internal 8 | { 9 | public class BooleanExpectationChecker : AbstractCheckerBase 10 | { 11 | 12 | public override bool IsAcceptable(string expected, object actual) 13 | { 14 | if (!(actual is bool)) return false; 15 | 16 | var boolActual = (bool) actual; 17 | var normalizedExpected = this.Normalize(expected).ToLower(); 18 | return (boolActual && Regex.IsMatch(normalizedExpected, "^(true|yes|y)$")) || 19 | (!boolActual && Regex.IsMatch(normalizedExpected, "^(false|no|n|-)$")); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Concordion/Internal/ChainOfExpectationCheckers.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Concordion.Internal 7 | { 8 | public class ChainOfExpectationCheckers : IExpectationChecker 9 | { 10 | private List checkers = new List(); 11 | 12 | public ChainOfExpectationCheckers Add(IExpectationChecker checker) 13 | { 14 | checkers.Add(checker); 15 | return this; 16 | } 17 | 18 | public bool IsAcceptable(string expected, object actual) 19 | { 20 | return this.checkers.Any(checker => checker.IsAcceptable(expected, actual)); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Concordion/Internal/Commands/IExecuteStrategy.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2009 Jeffrey Cameron 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | using Concordion.Api; 20 | 21 | namespace Concordion.Internal.Commands 22 | { 23 | internal interface IExecuteStrategy 24 | { 25 | void Execute(CommandCall commandCall, IEvaluator evaluator, IResultRecorder resultRecorder); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Concordion/Internal/ConcordionAssertionException.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2009 Jeffrey Cameron 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | using System.Runtime.Serialization; 20 | 21 | namespace Concordion.Internal 22 | { 23 | [Serializable] 24 | public class ConcordionAssertionException : Exception 25 | { 26 | public ConcordionAssertionException() 27 | : base() 28 | { 29 | } 30 | 31 | public ConcordionAssertionException(string message) 32 | : base(message) 33 | { 34 | } 35 | 36 | public ConcordionAssertionException(string message, Exception inner) 37 | : base(message, inner) 38 | { 39 | } 40 | 41 | public ConcordionAssertionException(SerializationInfo info, StreamingContext context) 42 | : base(info, context) 43 | { 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Concordion/Internal/ConcordionModule.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Ninject; 6 | using Ninject.Modules; 7 | using System.Collections; 8 | using Concordion.Internal.Commands; 9 | 10 | namespace Concordion.Internal 11 | { 12 | class ConcordionModule : NinjectModule 13 | { 14 | public override void Load() 15 | { 16 | //Bind().ToProvider(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Concordion/Internal/DefaultExpectationChecker.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Text.RegularExpressions; 6 | 7 | namespace Concordion.Internal 8 | { 9 | public class DefaultExpectationChecker : AbstractCheckerBase 10 | { 11 | public override bool IsAcceptable(string expected, object actual) 12 | { 13 | return this.Normalize(expected).Equals(this.Normalize(actual)); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Concordion/Internal/ExpectedToFailFixtureState.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Api; 6 | 7 | namespace Concordion.Internal 8 | { 9 | class ExpectedToFailFixtureState : IFixtureState 10 | { 11 | #region IFixtureState Members 12 | 13 | public void AssertIsSatisfied(long successCount, long failureCount, long exceptionCount) 14 | { 15 | if (failureCount + exceptionCount == 0) 16 | { 17 | throw new AssertionErrorException("Specification is expected to fail but has neither failures nor exceptions."); 18 | } 19 | } 20 | 21 | #endregion 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Concordion/Internal/ExpectedToPassFixtureState.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Api; 6 | 7 | namespace Concordion.Internal 8 | { 9 | class ExpectedToPassFixtureState : IFixtureState 10 | { 11 | #region IFixtureState Members 12 | 13 | public void AssertIsSatisfied(long successCount, long failureCount, long exceptionCount) 14 | { 15 | if (failureCount > 0L) 16 | { 17 | throw new AssertionErrorException("Specification has failure(s). See output HTML for details."); 18 | } 19 | 20 | if (exceptionCount > 0L) 21 | { 22 | throw new AssertionErrorException("Specification has exception(s). See output HTML for details."); 23 | } 24 | } 25 | 26 | #endregion 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Concordion/Internal/IExpectationChecker.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Concordion.Internal 7 | { 8 | public interface IExpectationChecker 9 | { 10 | bool IsAcceptable(string expected, object actual); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Concordion/Internal/IExpressionValidator.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2009 Jeffrey Cameron 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | 20 | namespace Concordion.Internal 21 | { 22 | interface IExpressionValidator 23 | { 24 | void Validate(string expression); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Concordion/Internal/IFixtureState.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Concordion.Internal 7 | { 8 | interface IFixtureState 9 | { 10 | void AssertIsSatisfied(long successCount, long failureCount, long exceptionCount); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Concordion/Internal/ListEntry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Api; 6 | 7 | namespace Concordion.Internal 8 | { 9 | public class ListEntry 10 | { 11 | #region Properties 12 | 13 | public Element Element 14 | { 15 | get; 16 | private set; 17 | } 18 | 19 | public bool IsItem 20 | { 21 | get 22 | { 23 | return Element.IsNamed("li"); 24 | } 25 | } 26 | 27 | public bool IsList 28 | { 29 | get 30 | { 31 | return (Element.IsNamed("ul") || Element.IsNamed("ol")); 32 | } 33 | } 34 | 35 | #endregion 36 | 37 | #region Constructors 38 | 39 | public ListEntry(Element element) 40 | { 41 | this.Element = element; 42 | } 43 | 44 | #endregion 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Concordion/Internal/Listener/AssertResultRenderer.cs: -------------------------------------------------------------------------------- 1 | using Concordion.Api; 2 | using Concordion.Api.Listener; 3 | 4 | namespace Concordion.Internal.Listener 5 | { 6 | class AssertResultRenderer : IAssertEqualsListener, IAssertTrueListener, IAssertFalseListener 7 | { 8 | public void SuccessReported(AssertSuccessEvent successEvent) 9 | { 10 | successEvent.Element 11 | .AddStyleClass("success") 12 | .AppendNonBreakingSpaceIfBlank(); 13 | } 14 | 15 | public void FailureReported(AssertFailureEvent failureEvent) 16 | { 17 | var element = failureEvent.Element; 18 | element.AddStyleClass("failure"); 19 | 20 | var spanExpected = new Element("del"); 21 | spanExpected.AddStyleClass("expected"); 22 | element.MoveChildrenTo(spanExpected); 23 | element.AppendChild(spanExpected); 24 | spanExpected.AppendNonBreakingSpaceIfBlank(); 25 | 26 | var spanActual = new Element("ins"); 27 | spanActual.AddStyleClass("actual"); 28 | spanActual.AppendText(failureEvent.Actual != null ? failureEvent.Actual.ToString() : "(null)"); 29 | spanActual.AppendNonBreakingSpaceIfBlank(); 30 | 31 | element.AppendText("\n"); 32 | element.AppendChild(spanActual); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Concordion/Internal/Listener/JavaScriptEmbedder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Xml.Linq; 6 | using Concordion.Api.Listener; 7 | using Concordion.Internal.Util; 8 | 9 | namespace Concordion.Internal.Listener 10 | { 11 | public class JavaScriptEmbedder : IDocumentParsingListener 12 | { 13 | #region Fields 14 | 15 | private readonly String m_JavaScript; 16 | 17 | #endregion 18 | 19 | 20 | #region Constructors 21 | 22 | public JavaScriptEmbedder(string javaScript) 23 | { 24 | this.m_JavaScript = javaScript; 25 | } 26 | 27 | #endregion 28 | 29 | 30 | #region IDocumentParsingListener Members 31 | 32 | public void BeforeParsing(XDocument document) 33 | { 34 | XElement html = document.Root; 35 | XElement head = html.Element("head"); 36 | Check.NotNull(head, " section is missing from document"); 37 | XElement script = new XElement("script"); 38 | script.SetAttributeValue(XName.Get("type"), "text/javascript"); 39 | script.Add(this.m_JavaScript); 40 | head.AddFirst(script); 41 | } 42 | 43 | #endregion 44 | 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Concordion/Internal/Listener/RunResultRenderer.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2009 Jeffrey Cameron 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | using Concordion.Api.Listener; 16 | 17 | namespace Concordion.Internal.Listener 18 | { 19 | public class RunResultRenderer : ExceptionRenderer, IRunListener 20 | { 21 | #region IRunListener Members 22 | 23 | public void SuccessReported(RunSuccessEvent runSuccessEvent) 24 | { 25 | runSuccessEvent.Element.AddStyleClass("success").AppendNonBreakingSpaceIfBlank(); 26 | } 27 | 28 | public void FailureReported(RunFailureEvent runFailureEvent) 29 | { 30 | runFailureEvent.Element.AddStyleClass("failure").AppendNonBreakingSpaceIfBlank(); 31 | } 32 | 33 | public void IgnoredReported(RunIgnoreEvent runIgnoreEvent) 34 | { 35 | runIgnoreEvent.Element.AddStyleClass("ignored").AppendNonBreakingSpaceIfBlank(); 36 | } 37 | 38 | #endregion 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Concordion/Internal/Listener/VerifyRowResultRenderer.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2009 Jeffrey Cameron 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | using Concordion.Api; 16 | using Concordion.Api.Listener; 17 | 18 | namespace Concordion.Internal.Listener 19 | { 20 | public class VerifyRowResultRenderer : IVerifyRowsListener 21 | { 22 | #region IVerifyRowsListener Members 23 | 24 | public void ExpressionEvaluated(ExpressionEvaluatedEvent expressionEvaluatedEvent) 25 | { 26 | 27 | } 28 | 29 | public void MissingRow(MissingRowEvent missingRowEvent) 30 | { 31 | Element element = missingRowEvent.RowElement; 32 | element.AddStyleClass("missing"); 33 | } 34 | 35 | public void SurplusRow(SurplusRowEvent surplusRowEvent) 36 | { 37 | Element element = surplusRowEvent.RowElement; 38 | element.AddStyleClass("surplus"); 39 | } 40 | 41 | #endregion 42 | 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Concordion/Internal/ObjectFactory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Ninject; 6 | using Ninject.Parameters; 7 | 8 | namespace Concordion.Internal 9 | { 10 | public static class ObjectFactory 11 | { 12 | private static IKernel _kernel = new StandardKernel(new ConcordionModule()); 13 | 14 | public static T Resolve() 15 | { 16 | return _kernel.Get(); 17 | } 18 | 19 | public static T Resolve(params IParameter[] parameters) 20 | { 21 | return _kernel.Get(parameters); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Concordion/Internal/ParsingEventArgs.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2009 Jeffrey Cameron 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | using System.Xml.Linq; 20 | 21 | namespace Concordion.Internal 22 | { 23 | public class DocumentParsingEventArgs : EventArgs 24 | { 25 | public XDocument Document 26 | { 27 | get; 28 | set; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Concordion/Internal/SimpleEvaluatorFactory.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2009 Jeffrey Cameron 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | using Concordion.Api; 20 | 21 | namespace Concordion.Internal 22 | { 23 | public class SimpleEvaluatorFactory : IEvaluatorFactory 24 | { 25 | #region IEvaluatorFactory Members 26 | 27 | public IEvaluator CreateEvaluator(object fixture) 28 | { 29 | return new SimpleEvaluator(fixture); 30 | } 31 | 32 | #endregion 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Concordion/Internal/StringExtensionMethods.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2009 Jeffrey Cameron 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | 20 | namespace Concordion.Internal 21 | { 22 | public static class StringExtensionMethods 23 | { 24 | public static string RemoveFirst(this string str, string toRemove) 25 | { 26 | if (String.IsNullOrEmpty(toRemove)) return String.Empty; 27 | var index = str.IndexOf(toRemove); 28 | var builder = new StringBuilder(); 29 | 30 | if (index != -1) 31 | { 32 | builder.Append(str.Substring(0, index)); 33 | builder.Append(str.Substring(index + toRemove.Length)); 34 | return builder.ToString(); 35 | } 36 | 37 | return str; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Concordion/Internal/UnimplementedFixtureState.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Concordion.Api; 6 | 7 | namespace Concordion.Internal 8 | { 9 | class UnimplementedFixtureState : IFixtureState 10 | { 11 | #region IFixtureState Members 12 | 13 | public void AssertIsSatisfied(long successCount, long failureCount, long exceptionCount) 14 | { 15 | if (successCount + failureCount + exceptionCount > 0) 16 | { 17 | throw new AssertionErrorException("Fixture is marked as Unimplemented but is reporting assertion(s)."); 18 | } 19 | } 20 | 21 | #endregion 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Concordion/Internal/Util/Announcer.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2009 Jeffrey Cameron 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | 20 | namespace Concordion.Internal.Util 21 | { 22 | public class Announcer 23 | { 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Concordion/Internal/Util/IOUtil.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace Concordion.Internal.Util 8 | { 9 | public class IOUtil 10 | { 11 | private const int BufferSize = 4096; 12 | 13 | public static void Copy(TextReader inputReader, TextWriter outputWriter) 14 | { 15 | var buffer = new char[BufferSize]; 16 | var len = 0; 17 | while ((len = inputReader.Read(buffer, 0, BufferSize)) != -1) 18 | { 19 | outputWriter.Write(buffer, 0, len); 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Concordion/Internal/Util/TypeInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2009 Jeffrey Cameron 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | 20 | namespace Concordion.Internal.Util 21 | { 22 | public static class TypeInfo 23 | { 24 | public static T CreateInstance(string assemblyQualifiedName) 25 | { 26 | var concordionRunnerType = Type.GetType(assemblyQualifiedName); 27 | var concordionRunnerTypeConstructor = concordionRunnerType.GetConstructor(System.Type.EmptyTypes); 28 | var concordionRunnerImpl = (T)concordionRunnerTypeConstructor.Invoke(null); 29 | 30 | return concordionRunnerImpl; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Concordion/Internal/XmlSpecification.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2009 Jeffrey Cameron 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | using System.Text; 19 | using Concordion.Api; 20 | 21 | namespace Concordion.Internal 22 | { 23 | public class XmlSpecification : ISpecification 24 | { 25 | private CommandCall RootCommandNode 26 | { 27 | get; 28 | set; 29 | } 30 | 31 | public XmlSpecification(CommandCall rootCommandNode) 32 | { 33 | RootCommandNode = rootCommandNode; 34 | } 35 | 36 | public void Process(IEvaluator evaluator, IResultRecorder resultRecorder) 37 | { 38 | RootCommandNode.Execute(evaluator, resultRecorder); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Concordion/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:2.0.50727.4952 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Reflection; 13 | using System.Resources; 14 | using System.Runtime.CompilerServices; 15 | using System.Runtime.InteropServices; 16 | 17 | [assembly: AssemblyTitle("Concordion.NET")] 18 | [assembly: AssemblyDescription("Concordion Acceptance Testing Framework")] 19 | [assembly: AssemblyCompany("concordion.org")] 20 | [assembly: AssemblyProduct("Concordion")] 21 | [assembly: AssemblyCopyright("Copyright © concordion.org 2015")] 22 | [assembly: ComVisible(false)] 23 | [assembly: CLSCompliant(true)] 24 | [assembly: Guid("923eb1d8-0d6a-4a05-896c-16f127f2944f")] 25 | [assembly: AssemblyVersion("0.1.99.9999")] 26 | [assembly: AssemblyFileVersion("0.1.99.9999")] 27 | 28 | 29 | -------------------------------------------------------------------------------- /Concordion/Resources/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/Concordion/Resources/logo.png -------------------------------------------------------------------------------- /Concordion/Resources/visibility-toggler.js: -------------------------------------------------------------------------------- 1 | /* Stack Trace Toggling */ 2 | 3 | function getElementById(id) { 4 | var element; 5 | 6 | if (document.getElementById) { // standard 7 | return document.getElementById(id); 8 | } else if (document.all) { // old IE versions 9 | return document.all[id]; 10 | } else if (document.layers) { // nn4 11 | return document.layers[id]; 12 | } 13 | alert("Sorry, but your web browser is not supported by Concordion."); 14 | } 15 | 16 | function isVisible(element) { 17 | return element.style.display; 18 | } 19 | 20 | function makeVisible(element) { 21 | element.style.display = "block"; 22 | } 23 | 24 | function makeInvisible(element) { 25 | element.style.display = ""; 26 | } 27 | 28 | function toggleStackTrace(stackTraceNumber) { 29 | var stackTrace = getElementById("stackTrace" + stackTraceNumber); 30 | var stackTraceButton = getElementById("stackTraceButton" + stackTraceNumber); 31 | if (isVisible(stackTrace)) { 32 | makeInvisible(stackTrace); 33 | stackTraceButton.value = "View Stack"; 34 | } else { 35 | makeVisible(stackTrace); 36 | stackTraceButton.value = "Hide Stack"; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright 2010-2015 concordion.org 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /build.cmd: -------------------------------------------------------------------------------- 1 | "C:\WINDOWS\Microsoft.NET\Framework\v3.5\msbuild.exe" concordion.msbuild -------------------------------------------------------------------------------- /doc/Concordion/Attributes/Attributes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | 15 | 16 | 17 | 18 |

Attributes associated with Fixture Classes

19 | 20 |

21 | Concordion.NET does not use inheritance or naming conventions to 22 | identify its test classes. Instead attributes are used for this purpose. 23 | Thus, the developer is free to use inheritance for his own purpose and 24 | use names that convey the intended purpose of the fixture code. The 25 | following attributes can be used with Concordion.NET:

26 |
    27 |
  • [ConcordionTest] 28 | indicates that the associated class is a Concordion.NET test fixture.
  • 29 |
  • [Ignore] marks a Concordion.NET 30 | test class to be ignored by NUnit test runners.
  • 31 |
  • [TestFixtureSetUp] is 32 | used to show that the associated methods are called for initialization 33 | before the execution of the test code.
  • 34 |
35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /doc/Concordion/Command/AssertEquals/NestedActions.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

Nested Actions

6 | 7 |

8 | Though nested elements are supported, these 9 | elements may not contain commands. An "illegal markup" exception will be reported if 10 | any nested commands are detected. 11 |

12 | 13 |
14 | 15 |

Example

16 | 17 |

The following will result in an "illegal markup" exception being raised:

18 | 19 |
20 | <span concordion:assertEquals="#fullName">Fred 
21 |     <span concordion:set="#surname">Bloggs</span>
22 | </span> 
23 | 
24 | 25 |
26 | 27 | 28 | -------------------------------------------------------------------------------- /doc/Concordion/Command/AssertEquals/NonString/NullResult.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

Null Result

6 | 7 |

8 | If the evaluation result is null then the string 9 | "(null)" is used for performing the comparison. 10 |

11 | 12 |
13 | 14 |

Example

15 | 16 |
17 | <span concordion:assertEquals="myMethod()">(some expectation)</span>
18 | 
19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 |
myMethod()
Returns
The ExpectationOutcome
null(null)SUCCESS
nullxyzFAILURE
nullnullFAILURE
42 |
43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /doc/Concordion/Command/AssertEquals/NonString/VoidResult.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

Void Result

6 | 7 |

8 | If an expression returns a method that returns void then 9 | the result is treated as null. 10 |

11 | 12 |
13 | 14 |

Example

15 | 16 |

Given we have the following method in our fixture code:

17 | 18 |
19 | public void myVoidMethod() {
20 |     ...
21 | }
22 | 
23 | 24 |
25 |

26 | Then the following markup will cause a SUCCESS 27 | to be reported, since no return value can be obtained from myVoidMethod() 28 | the result is taken to be null: 29 |

30 | 31 |
32 | <span concordion:assertEquals="myVoidMethod()">(null)</span>
33 | 
34 | 35 |
36 | 37 |
38 |

39 | And, to demonstrate a counter-example, the following markup will report 40 | a FAILURE: 41 |

42 | 43 |
44 | <span concordion:assertEquals="myVoidMethod()">xyz</span>
45 | 
46 |
47 | 48 |
49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /doc/Concordion/Command/AssertEquals/SupportedElements.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

Supported Elements

6 | 7 |

8 | The assertEquals command can currently be used on any HTML element. 9 | There are currently no checks. 10 | 11 | However, you should avoid using the command on elements that cannot legally 12 | have a <span> child (e.g. <table>, 13 | <tr>, <ul>, <ol>). 14 |

15 | 16 |
17 | 18 |

Examples

19 | 20 |

All of these will work:

21 | 22 |
23 | <span concordion:assertEquals="#name">Fred</span>
24 | 
25 | 26 |
27 | <strong concordion:assertEquals="#name">Fred</strong>
28 | 
29 | 30 |
31 | <div concordion:assertEquals="#name">Fred</div>
32 | 
33 | 34 |
35 | <table>
36 |     <tr>
37 |         <td concordion:assertEquals="#name">Fred</td>
38 |     </tr>
39 | </table>
40 | 
41 | 42 |
43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /doc/Concordion/Command/AssertEquals/contents.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

assertequals - Further Details

6 | 7 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /doc/Concordion/Command/Command.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

Commands

6 | 7 |

8 | The following commands are available: 9 |

10 | 11 | 21 | 22 |

Further Details

23 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /doc/Concordion/Command/Echo/Echo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

echo

6 | 7 |

8 | The concordion:echo tag evaluates an expression and inserts 9 | the result into the output HTML. 10 |

11 | 12 |
13 | 14 |

Example

15 | 16 |

17 | If the expression "username" 18 | evaluates to "jbloggs" and we 19 | have the following instrumentation in our specification: 20 |

21 | 22 |
23 | <p>
24 |     Username: <span concordion:echo="username" />
25 | </p>    
26 | 
27 | 28 |

Then we expect the following output:

29 | 30 |
31 | <p>
32 |     Username: <span concordion:echo="username">jbloggs</span>
33 | </p>    
34 | 
35 | 36 |
37 | 38 |

Further Details

39 | 40 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /doc/Concordion/Command/Execute/Execute.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | "execute" 5 | 6 | 7 | 8 |

execute

9 | 10 |

11 | An execute command lets you run a method in the 12 | fixture code. 13 |

14 | 15 |
16 | 17 |

Example

18 | 19 |

The following instrumentation:

20 |
21 | <p concordion:execute="myMethod()">Some text goes here.</p>
22 | 
23 |

24 | Will 25 | call myMethod() in the fixture code. 26 |

27 | 28 |
29 | 30 |

Further Details

31 | 32 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /doc/Concordion/Command/Set/Set.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | "set" 5 | 6 | 7 | 8 |

set

9 | 10 |

11 | A set command sets a temporary variable to the 12 | text contents of the instrumented element, so that it can 13 | be referenced by another command. 14 |

15 | 16 |
17 | 18 |

Example

19 | 20 |

The following instrumentation:

21 |
22 | <p>
23 |     My name is <b concordion:set="#fullName">David Peterson</b>.
24 |     
25 |     <span concordion:execute="setUpUser(#fullName)" />
26 | </p>
27 | 
28 |

29 | Calls the method setUpUser() with the 30 | string value 31 | David Peterson. 32 |

33 |
34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /doc/Concordion/Configuration/BaseOutputDirectory.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

BaseOutputDirectory

6 |

The BaseOutputDirectory element tells Concordion.NET 7 | where to place the resulting Concordion test reports. If this element is 8 | not specified then Concordion.NET places the output in the directory 9 | defined by the users TEMP environment variable.

10 |
11 |
<?xml version="1.0" encoding="utf-8" ?>
12 | <Specification>
13 |   <BaseOutputDirectory path="C:\Dev\concordion-net\Results" />
14 | </Specification>
15 |
16 | 17 | -------------------------------------------------------------------------------- /doc/Concordion/Configuration/SpecificationSuffix.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

File extensions for specification documents

6 |

Per default Concordion.NET assumes that specification documents have the 7 | file extension ".html". With the SpecificationFileExtensions 8 | you can define which file extensions you want to use for your specification 9 | documents. You can even use several in parallel. This can be useful, when 10 | you are in the transition from one type of files to another (e.g. from html 11 | to xhtml).

12 |

To specify that html as well as xhmtl files should be considered as 13 | Concordion.NET specifications, you need to add the following configuration 14 | settings to your configuration:

15 |
<?xml version="1.0" encoding="utf-8" ?>
16 | <Specification>
17 |   <SpecificationFileExtensions>
18 |     <FileExtension name="html" />
19 |     <FileExtension name="xhtml" />
20 |   </SpecificationFileExtensions>
21 | </Specification>
22 | 23 | -------------------------------------------------------------------------------- /doc/Concordion/Configuration/SpecificationSuffixXhtml.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

Specification Suffix for XHTML

6 | 7 |

8 | Concordion can read and write to files using different file suffixes by configuring using the withSpecificationLocator() and 9 | withTarget() methods. 10 |

11 | 12 |
13 | 14 |

Example

15 | 16 |

This specification uses a suffix of ".xhtml" and has been processed by Concordion.

17 |

See FileSuffixExtensionsTest.cs for implementation details.

18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /doc/Concordion/Configuration/SpecificationSuffixXhtml.xhtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

Specification Suffix for XHTML

6 | 7 |

8 | Concordion can read and write to files using different file suffixes by configuring using the withSpecificationLocator() and 9 | withTarget() methods. 10 |

11 | 12 |
13 | 14 |

Example

15 | 16 |

This specification uses a suffix of ".xhtml" and has been processed by Concordion.

17 |

See FileSuffixExtensionsTest.cs for implementation details.

18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /doc/Concordion/Extension/Command/CustomCommand.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

Custom Commands

6 | 7 |

8 | Users can add their own commands to Concordion as extensions. User-contributed commands must use their own namespace that must not start with Concordion. 9 | Custom commands are automatically wrapped with a class that will notify ExceptionCaughtListeners of any Exceptions that are thrown by the command. 10 |

11 | 12 |
13 | 14 |

Example

15 | 16 |

An extension is installed that adds the log command in the http://myorg.org/my/extension namespace. This command simply logs the element text.

17 |

Running a specification containing:

18 |
19 | <div xmlns:myext="http://myorg.org/my/extension">
20 | <p myext:log="">The answer is 42</p>
21 | </div>
22 | 
23 | 
24 | 25 |

logs: 26 |

27 | 28 | 29 | 30 |
Output
The answer is 42
31 | 32 |
33 | 34 | 35 | -------------------------------------------------------------------------------- /doc/Concordion/Extension/Extension.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Extension

8 |

A Concordion extension introduces additional functionality to Concordion. Extensions are able to: 9 |

10 | 18 |

Further Questions

19 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /doc/Concordion/Extension/FileSuffix/FileSuffixExtensions.xhtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

File Suffix Extensions

6 | 7 |

8 | Concordion can read and write to files using different file suffixes by configuring an extension using the withSpecificationLocator() and 9 | withTarget() methods. 10 |

11 | 12 |
13 | 14 |

Example

15 | 16 |

This specification uses a suffix of ".xhtml" and has been processed by Concordion.

17 |

See FileSuffixExtensionsTest.cs for implementation details.

18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /doc/Concordion/Integration/Constructor.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Using Constructor of Fixture Class for Initialization

8 |

Similar to xUnit.NET, where setup of test is accomplished through a 9 | parameterless constructor, constructors of fixture classes can be used with 10 | Concordion.NET to setup execution of active specifications. Before the execution of 11 | all examples within an 12 | active specification the constructor without parameters is called.

13 |
14 |

Example

15 |

The fixture class for this specification contains a parameterless 16 | constructor, which is called once 17 | on test execution.

18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /doc/Concordion/Integration/Integration.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Integration 5 | 6 | 7 | 8 |

Running Active Specifications

9 | 10 |

11 | Concordion.NET integrates with 12 | one of the most popular testing frameworks, NUnit. Concordion.NET 13 | provides an NUnit-Addin that allows executing active 14 | specifications. Please, see the information below for more details on 15 | test execution:

16 | 24 | 25 | -------------------------------------------------------------------------------- /doc/Concordion/Integration/SetupMethod.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Using TestFixtureSetUp Attribute to Run before Test Execution

8 |

NUnit provides a mechanism to call functions just before each test 9 | execution. This is accomplished with the help of the NUnit 10 | TestFixtureSetUpAttribute.

11 |

This mechanism can be used in Concordion.NET as well. All methods marked 12 | with the attribute [TestFixtureSetUp] are executed before the actual processing of 13 | the active specification.

14 |
15 |

Example

16 |

The test fixture class for this specification contains two method with 17 | the TestFixtureSetUp attribute, which are 18 | called before test execution.

19 |
20 |

Further Details

21 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/Concordion/Results/AssertEquals/Failure/Anchors.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

Anchor Elements

6 | 7 |

8 | Anchor elements (<a>) have to be treated slightly differently to 9 | other elements to prevent the 'actual' value becoming a link. Rather than 10 | nesting <span> elements inside the <a>, we nest the <a> 11 | inside a new 'failure' <span>. 12 |

13 | 14 |
15 | 16 |

Example:

17 | 18 |
<a href="abc.html">ABC</a>
19 | 20 |

When marked as a failure, with actual value XYZ, it becomes:

21 | 22 |
23 | <span class="failure"> _
24 | <span class="expected"> _
25 | <a href="abc.html">ABC</a> _
26 | </span> _
27 | <span class="actual">XYZ</span> _
28 | </div>
29 | 
30 |
31 | 32 | 33 | -------------------------------------------------------------------------------- /doc/Concordion/Results/AssertEquals/Failure/NestedElements.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

Nested Elements

6 | 7 |

8 | Nested elements are moved into the 'expected' span. 9 |

10 | 11 |
12 | 13 |

Example

14 | 15 |
<div concordion:assertEquals="acronym">My <em>simple</em> example</div>
16 | 17 |

When marked as a failure, with actual value XYZ, it becomes:

18 | 19 |
20 | <div concordion:assertEquals="acronym" class="failure">
21 |   <del class="expected">My <em>simple</em> example</del>
22 |   <ins class="actual">XYZ</ins>
23 | </div>
24 | 
25 |
26 | 27 | 28 | -------------------------------------------------------------------------------- /doc/Concordion/Results/AssertEquals/Success/EmptySuccess.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

Empty Elements

6 | 7 |

8 | If the element is empty then a non-breaking space (&#160) is inserted so 9 | that there is something there to show the success. 10 |

11 | 12 |
13 | 14 |

Example

15 | 16 |
<span concordion:assertEquals="username"/>
17 | 18 |

When marked as a success becomes:

19 | 20 |
<span concordion:assertEquals="username" class="success">&#160;</span>
21 |
22 | 23 | 24 | -------------------------------------------------------------------------------- /doc/Concordion/Results/AssertEquals/Success/HasAttributes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

Element Already Has Attributes

6 | 7 |

8 | If an element already has attributes then these attributes will be 9 | retained. 10 |

11 | 12 |
13 | 14 |

Example

15 | 16 |
<span id="example" concordion:assertEquals="username">fred</span>
17 | 18 |

When marked as a success becomes:

19 | 20 |
<span id="example" concordion:assertEquals="username" class="success">fred</span>
21 |
22 | 23 |

Further Details

24 | 25 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /doc/Concordion/Results/AssertEquals/Success/HasClassAttribute.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

Element Already Has A Class Attribute

6 | 7 |

8 | If an element already has a class attribute then the new attribute will 9 | be appended to the existing value, separated by space. 10 |

11 | 12 |
13 | 14 |

Example

15 | 16 |
<span concordion:assertEquals="username" class="blah">fred</span>
17 | 18 |

When marked as a success becomes:

19 | 20 |
<span concordion:assertEquals="username" class="blah success">fred</span>
21 |
22 | 23 | 24 | -------------------------------------------------------------------------------- /doc/Concordion/Results/AssertEquals/Success/Success.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

Success

6 | 7 |

8 | Successes are indicated by adding a class="success" attribute to the element. 9 | Typically this will result in the element being displayed in green (depending on the CSS stylesheet). 10 |

11 | 12 |
13 | 14 |

Example

15 | 16 |
17 | <span concordion:assertEquals="username">fred</span>
18 | 
19 | 20 |

When marked as a success becomes:

21 | 22 |
23 | <span concordion:assertEquals="username" class="success">fred</span>
24 | 
25 |
26 | 27 |

Further Details

28 | 29 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /doc/Concordion/Results/AssertFalse/Failure/OnFailure.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Failures 5 | 6 | 7 | 8 |

Failures

9 | 10 |

11 | Failures are indicated by adding a class="failure" attribute to the element, 12 | and replacing the contents with a <del> and <ins> 13 | elements containing the expected value and the actual value respectively. 14 |

15 | 16 |
17 | 18 |

Example

19 | 20 |

21 | The output of running this: 22 |

23 | 24 |
<p concordion:assertFalse="isPalindrome(#TEXT)">ABBA</p>
25 | 26 |

Looks like this:

27 | 28 |
29 | <p concordion:assertFalse="isPalindrome(#TEXT)" class="failure">
30 |   <del class="expected">ABBA</del>
31 |   <ins class="actual">== true</ins>
32 | </p>
33 | 
34 |

Note: The underscores indicate line continuations for readability only. They are not output. In reality, it is all in one long line.

35 | 36 |
37 | 38 | 39 | -------------------------------------------------------------------------------- /doc/Concordion/Results/AssertFalse/Success/OnSuccess.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Success 5 | 6 | 7 | 8 |

Success

9 | 10 |

11 | Successes are indicated by adding a class="success" attribute to the element. 12 |

13 | 14 |
15 | 16 |

Example

17 | 18 |

19 | The output of running this: 20 |

21 | 22 |
<p concordion:assertFalse="isPalindrome(#TEXT)">ABB</p>
23 | 24 |

Looks like this:

25 | 26 |
27 | <p concordion:assertFalse="isPalindrome(#TEXT)" class="success">ABB</p>
28 | 
29 | 30 |
31 | 32 | 33 | -------------------------------------------------------------------------------- /doc/Concordion/Results/AssertTrue/Failure/Failure.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Failures 5 | 6 | 7 | 8 |

Failures

9 | 10 |

11 | Failures are indicated by adding a class="failure" attribute to the element, 12 | and replacing the contents with a <del> and <ins> 13 | elements containing the expected value and the actual value respectively. 14 |

15 | 16 |
17 | 18 |

Example

19 | 20 |

21 | The output of running this: 22 |

23 | 24 |
<p concordion:assertTrue="isPalindrome(#TEXT)">ABB</p>
25 | 26 |

Looks like this:

27 | 28 |
29 | <p concordion:assertTrue="isPalindrome(#TEXT)" class="failure">
30 |   <del class="expected">ABB</del>
31 |   <ins class="actual">== false</ins>
32 | </p>
33 | 
34 |

Note: The underscores indicate line continuations for readability only. They are not output. In reality, it is all in one long line.

35 | 36 |
37 | 38 | 39 | -------------------------------------------------------------------------------- /doc/Concordion/Results/AssertTrue/Success/Success.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Success 5 | 6 | 7 | 8 |

Success

9 | 10 |

11 | Successes are indicated by adding a class="success" attribute to the element. 12 |

13 | 14 |
15 | 16 |

Example

17 | 18 |

19 | The output of running this: 20 |

21 | 22 |
<p concordion:assertTrue="isPalindrome(#TEXT)">ABBA</p>
23 | 24 |

Looks like this:

25 | 26 |
27 | <p concordion:assertTrue="isPalindrome(#TEXT)" class="success">ABBA</p>
28 | 
29 | 30 |
31 | 32 | 33 | -------------------------------------------------------------------------------- /doc/Examples/Demo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

Demo

6 | 7 |

8 | After a user logs into the system, a greeting is 9 | displayed saying "Hello [user's first name]!" 10 |

11 | 12 |
13 | 14 |

Example

15 | 16 |

17 | When user Bob 18 | logs in, the greeting will be: 19 | Hello Bob! 20 |

21 | 22 |

23 | The first name starts 24 | with B. 25 |

26 | 27 |

28 | The first name starts 29 | with B. 30 |

31 |
32 | 33 | 34 | -------------------------------------------------------------------------------- /doc/Examples/PartialMatches.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

Partial Matches

6 | 7 |

8 | Username searches return partial matches, i.e. all usernames containing 9 | the search string are returned. 10 |

11 | 12 |
13 | 14 |

Example

15 | 16 |

Given these users:

17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
Username
john.lennon
ringo.starr
george.harrison
paul.mcartney
25 | 26 |

Searching for "arr" will return:

27 | 28 | 29 | 30 | 31 | 32 |
Matching Usernames
ringo.starr
george.harrison
33 | 34 |
35 | 36 | 37 | -------------------------------------------------------------------------------- /doc/Examples/Spike.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Spike 6 | 7 | 8 |

Spike

9 | 10 |

11 | The greeting Hello David! 12 | should be displayed for David 13 | when he logs in. 14 |

15 | 16 |

17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
First NameLast Name
JohnTravolta
28 | 29 | 30 | -------------------------------------------------------------------------------- /doc/image/AnatomyOfAnActiveSpec.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/doc/image/AnatomyOfAnActiveSpec.jpg -------------------------------------------------------------------------------- /doc/image/ClassicalSpecification.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/doc/image/ClassicalSpecification.jpg -------------------------------------------------------------------------------- /doc/image/DocumentationSpecification.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/doc/image/DocumentationSpecification.jpg -------------------------------------------------------------------------------- /doc/image/ExternalLink.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/doc/image/ExternalLink.png -------------------------------------------------------------------------------- /doc/image/HelloWorldSuccess.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/doc/image/HelloWorldSuccess.jpg -------------------------------------------------------------------------------- /doc/image/HowItWorks.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/doc/image/HowItWorks.jpg -------------------------------------------------------------------------------- /doc/image/NuGet_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/doc/image/NuGet_logo.png -------------------------------------------------------------------------------- /doc/image/NunitResult.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/doc/image/NunitResult.jpg -------------------------------------------------------------------------------- /doc/image/ReSharperSessions.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/doc/image/ReSharperSessions.jpg -------------------------------------------------------------------------------- /doc/image/SpecificationProperties.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/doc/image/SpecificationProperties.jpg -------------------------------------------------------------------------------- /doc/image/concordion-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/doc/image/concordion-logo.png -------------------------------------------------------------------------------- /doc/image/download.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/doc/image/download.gif -------------------------------------------------------------------------------- /doc/image/example/online-shop/AcceptanceTest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/doc/image/example/online-shop/AcceptanceTest.png -------------------------------------------------------------------------------- /doc/image/example/online-shop/ConcordionRunExample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/doc/image/example/online-shop/ConcordionRunExample.png -------------------------------------------------------------------------------- /doc/image/example/online-shop/RoughScope.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/doc/image/example/online-shop/RoughScope.png -------------------------------------------------------------------------------- /doc/image/example/online-shop/StoryCard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/doc/image/example/online-shop/StoryCard.png -------------------------------------------------------------------------------- /doc/image/example/online-shop/StoryPage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/doc/image/example/online-shop/StoryPage.png -------------------------------------------------------------------------------- /doc/image/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/doc/image/favicon.ico -------------------------------------------------------------------------------- /doc/image/flag/chinese.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/doc/image/flag/chinese.png -------------------------------------------------------------------------------- /doc/image/flag/french.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/doc/image/flag/french.png -------------------------------------------------------------------------------- /doc/image/flag/german.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/doc/image/flag/german.png -------------------------------------------------------------------------------- /doc/image/flag/polish.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/doc/image/flag/polish.png -------------------------------------------------------------------------------- /doc/image/flag/portuguese.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/doc/image/flag/portuguese.png -------------------------------------------------------------------------------- /doc/image/flag/russian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/doc/image/flag/russian.png -------------------------------------------------------------------------------- /doc/image/flag/spanish.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/doc/image/flag/spanish.png -------------------------------------------------------------------------------- /doc/image/front-page-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/doc/image/front-page-banner.png -------------------------------------------------------------------------------- /doc/image/opensource-110x95.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/doc/image/opensource-110x95.png -------------------------------------------------------------------------------- /doc/image/project-structure.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/doc/image/project-structure.jpg -------------------------------------------------------------------------------- /doc/image/social/facebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/doc/image/social/facebook.png -------------------------------------------------------------------------------- /doc/image/social/google-plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/doc/image/social/google-plus.png -------------------------------------------------------------------------------- /doc/image/social/linkedin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/doc/image/social/linkedin.png -------------------------------------------------------------------------------- /doc/image/social/pinterest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/doc/image/social/pinterest.png -------------------------------------------------------------------------------- /doc/image/social/twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/doc/image/social/twitter.png -------------------------------------------------------------------------------- /tools/MSBuildCommunityTasks/ICSharpCode.SharpZipLib.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/tools/MSBuildCommunityTasks/ICSharpCode.SharpZipLib.dll -------------------------------------------------------------------------------- /tools/MSBuildCommunityTasks/MSBuild.Community.Tasks.License.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009, pwelter34 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 5 | 6 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * Neither the name of the nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 9 | 10 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /tools/MSBuildCommunityTasks/MSBuild.Community.Tasks.chm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/tools/MSBuildCommunityTasks/MSBuild.Community.Tasks.chm -------------------------------------------------------------------------------- /tools/MSBuildCommunityTasks/MSBuild.Community.Tasks.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/tools/MSBuildCommunityTasks/MSBuild.Community.Tasks.dll -------------------------------------------------------------------------------- /tools/MSBuildCommunityTasks/MSBuild.Community.Tasks.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/tools/MSBuildCommunityTasks/MSBuild.Community.Tasks.pdb -------------------------------------------------------------------------------- /tools/Moq/Moq.chm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/tools/Moq/Moq.chm -------------------------------------------------------------------------------- /tools/Moq/Moq.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/tools/Moq/Moq.dll -------------------------------------------------------------------------------- /tools/Moq/Moq.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/tools/Moq/Moq.pdb -------------------------------------------------------------------------------- /tools/NUnit-2.6.4/nunit.core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/tools/NUnit-2.6.4/nunit.core.dll -------------------------------------------------------------------------------- /tools/NUnit-2.6.4/nunit.core.interfaces.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/tools/NUnit-2.6.4/nunit.core.interfaces.dll -------------------------------------------------------------------------------- /tools/NUnit-2.6.4/nunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/tools/NUnit-2.6.4/nunit.framework.dll -------------------------------------------------------------------------------- /tools/Ninject/Ninject.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/tools/Ninject/Ninject.dll -------------------------------------------------------------------------------- /tools/OGNL.NET/OGNL.Net.source-modified-for-concordion.7z: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/tools/OGNL.NET/OGNL.Net.source-modified-for-concordion.7z -------------------------------------------------------------------------------- /tools/OGNL.NET/OGNL.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/concordion/concordion-net/643b7c09d5b3c0e076845fb165e2a8342a149017/tools/OGNL.NET/OGNL.dll --------------------------------------------------------------------------------