Navigation Menu

Skip to content
This repository has been archived by the owner on Jun 12, 2021. It is now read-only.

Commit

Permalink
Merge pull request #11 from adamralph/rc1
Browse files Browse the repository at this point in the history
expanded samples for RC smoke tests
  • Loading branch information
adamralph committed Mar 26, 2015
2 parents cb18188 + d67b795 commit 8ed8b01
Show file tree
Hide file tree
Showing 28 changed files with 289 additions and 15 deletions.
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Xbehave.2.0.0-beta008-build523\build\portable-net45\Xbehave.props" Condition="Exists('..\packages\Xbehave.2.0.0-beta008-build523\build\portable-net45\Xbehave.props')" />
<Import Project="..\packages\xunit.runner.msbuild.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.runner.msbuild.props" Condition="Exists('..\packages\xunit.runner.msbuild.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.runner.msbuild.props')" />
<Import Project="..\packages\xunit.runner.visualstudio.2.0.0\build\net20\xunit.runner.visualstudio.props" Condition="Exists('..\packages\xunit.runner.visualstudio.2.0.0\build\net20\xunit.runner.visualstudio.props')" />
<Import Project="..\packages\xunit.core.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.props" Condition="Exists('..\packages\xunit.core.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
Expand All @@ -11,10 +10,10 @@
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>410529e9-b417-44d0-a48e-b3009e16783e</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>Xbehave.Samples.FSharp.Net45</RootNamespace>
<AssemblyName>Xbehave.Samples.FSharp</AssemblyName>
<RootNamespace>Xbehave.Samples.FSharp</RootNamespace>
<AssemblyName>Xbehave.Samples.FSharp.net45.ncrunch</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<Name>Xbehave.Samples.FSharp.Net45</Name>
<Name>Xbehave.Samples.FSharp</Name>
<TargetFSharpCoreVersion>4.3.0.0</TargetFSharpCoreVersion>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>1e420621</NuGetPackageImportStamp>
Expand Down Expand Up @@ -101,15 +100,13 @@
</PropertyGroup>
<Error Condition="!Exists('..\packages\xunit.core.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.core.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.props'))" />
<Error Condition="!Exists('..\packages\xunit.runner.visualstudio.2.0.0\build\net20\xunit.runner.visualstudio.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.runner.visualstudio.2.0.0\build\net20\xunit.runner.visualstudio.props'))" />
<Error Condition="!Exists('..\packages\xunit.runner.msbuild.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.runner.msbuild.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.runner.msbuild.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.runner.msbuild.props'))" />
<Error Condition="!Exists('..\packages\Xbehave.2.0.0-beta008-build523\build\portable-net45\Xbehave.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xbehave.2.0.0-beta008-build523\build\portable-net45\Xbehave.props'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
-->
<Target Name="AfterBuild" Condition="Exists('..\packages\xunit.runner.msbuild.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.runner.msbuild.props')">
<xunit Assemblies="$(OutputPath)\$(AssemblyName).dll" />
<Target Name="AfterBuild">
</Target>
-->
</Project>
Binary file not shown.
Expand Up @@ -6,6 +6,5 @@
<package id="xunit.assert" version="2.0.0" targetFramework="net451" />
<package id="xunit.core" version="2.0.0" targetFramework="net451" />
<package id="xunit.extensibility.core" version="2.0.0" targetFramework="net451" />
<package id="xunit.runner.msbuild" version="2.0.0" targetFramework="net451" />
<package id="xunit.runner.visualstudio" version="2.0.0" targetFramework="net451" />
</packages>
112 changes: 112 additions & 0 deletions src/Xbehave.Samples.Net45.MSBuild/Xbehave.Samples.Net45.MSBuild.csproj
@@ -0,0 +1,112 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Xbehave.2.0.0-beta008-build523\build\portable-net45\Xbehave.props" Condition="Exists('..\packages\Xbehave.2.0.0-beta008-build523\build\portable-net45\Xbehave.props')" />
<Import Project="..\packages\xunit.runner.msbuild.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.runner.msbuild.props" Condition="Exists('..\packages\xunit.runner.msbuild.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.runner.msbuild.props')" />
<Import Project="..\packages\xunit.runner.visualstudio.2.0.0\build\net20\xunit.runner.visualstudio.props" Condition="Exists('..\packages\xunit.runner.visualstudio.2.0.0\build\net20\xunit.runner.visualstudio.props')" />
<Import Project="..\packages\xunit.core.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.props" Condition="Exists('..\packages\xunit.core.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{27E0ED44-121C-4DC5-AD15-B43EF6E3DDF0}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Xbehave.Samples</RootNamespace>
<AssemblyName>Xbehave.Samples.net45.msbuild</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>40e130ff</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;NET40</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<StyleCopTreatErrorsAsWarnings>true</StyleCopTreatErrorsAsWarnings>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsNotAsErrors>612,618</WarningsNotAsErrors>
<CodeAnalysisRuleSet>..\Xbehave.Samples.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;DEBUG;NET40</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<StyleCopTreatErrorsAsWarnings>true</StyleCopTreatErrorsAsWarnings>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsNotAsErrors>612,618</WarningsNotAsErrors>
<CodeAnalysisRuleSet>..\Xbehave.Samples.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\Xbehave.Samples.Net45.NCrunch\**\*.cs" Exclude="..\Xbehave.Samples.Net45.NCrunch\NCrunchCoverageIssues\*.cs;..\Xbehave.Samples.Net45.NCrunch\**\TemporaryGeneratedFile_*.cs;..\Xbehave.Samples.Net45.NCrunch\**\Failures.cs">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
<ItemGroup>
<Reference Include="FluentAssertions, Version=3.3.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\FluentAssertions.3.3.0\lib\net45\FluentAssertions.dll</HintPath>
</Reference>
<Reference Include="FluentAssertions.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\FluentAssertions.3.3.0\lib\net45\FluentAssertions.Core.dll</HintPath>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="Xbehave, Version=2.0.0.0, Culture=neutral, PublicKeyToken=e4957f48888f9fe8, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Xbehave.2.0.0-beta008-build523\lib\portable-net45\Xbehave.dll</HintPath>
</Reference>
<Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll</HintPath>
</Reference>
<Reference Include="xunit.assert, Version=2.0.0.2929, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\xunit.assert.2.0.0\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.assert.dll</HintPath>
</Reference>
<Reference Include="xunit.core, Version=2.0.0.2929, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\xunit.extensibility.core.2.0.0\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\xunit.core.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.core.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.props'))" />
<Error Condition="!Exists('..\packages\StyleCop.MSBuild.4.7.49.1\build\StyleCop.MSBuild.Targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\StyleCop.MSBuild.4.7.49.1\build\StyleCop.MSBuild.Targets'))" />
<Error Condition="!Exists('..\packages\xunit.runner.visualstudio.2.0.0\build\net20\xunit.runner.visualstudio.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.runner.visualstudio.2.0.0\build\net20\xunit.runner.visualstudio.props'))" />
<Error Condition="!Exists('..\packages\xunit.runner.msbuild.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.runner.msbuild.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.runner.msbuild.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.runner.msbuild.props'))" />
<Error Condition="!Exists('..\packages\Xbehave.2.0.0-beta008-build523\build\portable-net45\Xbehave.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xbehave.2.0.0-beta008-build523\build\portable-net45\Xbehave.props'))" />
</Target>
<Import Project="..\packages\StyleCop.MSBuild.4.7.49.1\build\StyleCop.MSBuild.Targets" Condition="Exists('..\packages\StyleCop.MSBuild.4.7.49.1\build\StyleCop.MSBuild.Targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
-->
<Target Name="AfterBuild" Condition="Exists('..\packages\xunit.runner.msbuild.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.runner.msbuild.props')">
<xunit Assemblies="$(OutputPath)\$(AssemblyName).dll" />
</Target>
</Project>
Binary file not shown.
13 changes: 13 additions & 0 deletions src/Xbehave.Samples.Net45.MSBuild/packages.config
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="FluentAssertions" version="3.3.0" targetFramework="net451" />
<package id="StyleCop.MSBuild" version="4.7.49.1" targetFramework="net451" developmentDependency="true" />
<package id="Xbehave" version="2.0.0-beta008-build523" targetFramework="net451" />
<package id="xunit" version="2.0.0" targetFramework="net451" />
<package id="xunit.abstractions" version="2.0.0" targetFramework="net451" />
<package id="xunit.assert" version="2.0.0" targetFramework="net451" />
<package id="xunit.core" version="2.0.0" targetFramework="net451" />
<package id="xunit.extensibility.core" version="2.0.0" targetFramework="net451" />
<package id="xunit.runner.msbuild" version="2.0.0" targetFramework="net451" />
<package id="xunit.runner.visualstudio" version="2.0.0" targetFramework="net451" />
</packages>
112 changes: 112 additions & 0 deletions src/Xbehave.Samples.Net45.NCrunch/Failures.cs
@@ -0,0 +1,112 @@
// <copyright file="Failures.cs" company="xBehave.net contributors">
// Copyright (c) xBehave.net contributors. All rights reserved.
// </copyright>

namespace Xbehave.Samples
{
using System;
using System.Reflection;
using FluentAssertions;
using Xbehave;
using Xunit.Sdk;

public class Failures
{
[Scenario]
public void FailingScenario()
{
true.Should().Be(false);
}

[Scenario]
public void FailingStep()
{
"Given true is false"
.f(() => true.Should().Be(false));
}

[Scenario]
public void PassingStepAndFailingStep()
{
"Given true is true"
.f(() => true.Should().Be(true));

"Then true is false"
.f(() => true.Should().Be(false));
}

[Scenario]
public void FailingStepAndPassingStep()
{
"Given true is false"
.f(() => true.Should().Be(false));

"Then true is true"
.f(() => true.Should().Be(true));
}

[Scenario]
public void FailingDisposal()
{
"Given a failing disposable"
.f(c => new FailingDisposable().Using(c));
}

[Scenario]
public void FailingTeardown()
{
"Given a fixture which believes true is false"
.f(c => { })
.Teardown(() => true.Should().BeFalse());
}

[Scenario]
[FailingBefore]
public void FailingBefore()
{
}

[Scenario]
[FailingAfter]
public void FailingAfter()
{
}

public class FailingFeatureClass
{
public FailingFeatureClass()
{
true.Should().BeFalse();
}

[Scenario]
public void SomeScenario()
{
}
}

public sealed class FailingDisposable : IDisposable
{
public void Dispose()
{
true.Should().BeFalse();
}
}

public class FailingBeforeAttribute : BeforeAfterTestAttribute
{
public override void Before(MethodInfo methodUnderTest)
{
true.Should().BeFalse();
}
}

public class FailingAfterAttribute : BeforeAfterTestAttribute
{
public override void After(MethodInfo methodUnderTest)
{
true.Should().BeFalse();
}
}
}
}
Expand Up @@ -17,15 +17,15 @@ public void TwoPassingSteps(int answer)
.f(() => answer = new TwoPassingStepsSut().GetAnswer());

// NCrunch shows the expression in this step as covered
"Then 42"
"Then the answer is 42"
.f(() => answer.Should().Be(42));
}

[Scenario]
public void OnePassingStep()
{
// NCrunch shows the expression in this step as covered
"When I Get an answer"
"When I get an answer"
.f(() => new OnePassingStepSut().GetAnswer());
}

Expand Down
33 changes: 33 additions & 0 deletions src/Xbehave.Samples.Net45.NCrunch/SkippedScenarios.cs
@@ -0,0 +1,33 @@
// <copyright file="SkippedScenarios.cs" company="xBehave.net contributors">
// Copyright (c) xBehave.net contributors. All rights reserved.
// </copyright>

namespace Xbehave.Samples
{
using FluentAssertions;
using Xbehave;
using Xbehave.Samples.Fixtures;
using Xunit;

public class SkippedScenarios
{
[Scenario(Skip = "It's no good, I just can't figure out addition today.")]
public void Addition(int x, int y, Calculator calculator, int answer)
{
"Given the number 1"
.f(() => x = 1);

"And the number 2"
.f(() => y = 2);

"And a calculator"
.f(() => calculator = new Calculator());

"When I add the numbers together"
.f(() => answer = calculator.Add(x, y));

"Then the answer is 3"
.f(() => answer.Should().Be(3));
}
}
}
Expand Up @@ -2,7 +2,7 @@
// Copyright (c) xBehave.net contributors. All rights reserved.
// </copyright>

namespace Xbehave.Samples.Net40
namespace Xbehave.Samples
{
using System;
using System.Diagnostics.CodeAnalysis;
Expand Down
Expand Up @@ -12,7 +12,7 @@
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Xbehave.Samples</RootNamespace>
<AssemblyName>Xbehave.Samples.net45</AssemblyName>
<AssemblyName>Xbehave.Samples.net45.ncrunch</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
Expand Down Expand Up @@ -54,6 +54,8 @@
<Compile Include="Fixtures\Calculator.cs" />
<Compile Include="Fixtures\Disposable.cs" />
<Compile Include="AsyncSteps.cs" />
<Compile Include="Failures.cs" />
<Compile Include="SkippedScenarios.cs" />
<Compile Include="Synonyms.cs" />
<Compile Include="TheLot.cs" />
<Compile Include="Examples.cs" />
Expand Down
Binary file not shown.

0 comments on commit 8ed8b01

Please sign in to comment.