Skip to content

Commit

Permalink
Merge branch 'release/0.7.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalberger committed May 30, 2019
2 parents 389fd31 + 4b8ea0f commit bb85bee
Show file tree
Hide file tree
Showing 48 changed files with 2,834 additions and 101 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ and for general information about the Cake build automation system see the [Cake

## Build Status

|Develop|Master|
|:--:|:--:|
|[![Build status](https://ci.appveyor.com/api/projects/status/sde2oe3lu4kpmw0r/branch/develop?svg=true)](https://ci.appveyor.com/project/cakecontrib/cake-issues/branch/develop)|[![Build status](https://ci.appveyor.com/api/projects/status/sde2oe3lu4kpmw0r/branch/master?svg=true)](https://ci.appveyor.com/project/cakecontrib/cake-issues/branch/master)|
| | Develop | Master |
|:--:|:--:|:--:|
|AppVeyor Windows|[![Build status](https://ci.appveyor.com/api/projects/status/sde2oe3lu4kpmw0r/branch/develop?svg=true)](https://ci.appveyor.com/project/cakecontrib/cake-issues/branch/develop)|[![Build status](https://ci.appveyor.com/api/projects/status/sde2oe3lu4kpmw0r/branch/master?svg=true)](https://ci.appveyor.com/project/cakecontrib/cake-issues/branch/master)|
|Azure DevOps Windows|[![Build Status](https://dev.azure.com/cake-contrib/Cake.Issues/_apis/build/status/cake-contrib.Cake.Issues?branchName=develop&jobName=Windows)](https://dev.azure.com/cake-contrib/Cake.Issues/_build/latest?definitionId=2?branchName=develop)|[![Build Status](https://dev.azure.com/cake-contrib/Cake.Issues/_apis/build/status/cake-contrib.Cake.Issues?branchName=master&jobName=Windows)](https://dev.azure.com/cake-contrib/Cake.Issues/_build/latest?definitionId=2?branchName=master)|

## Code Coverage

Expand Down
16 changes: 16 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
trigger:
- develop
- master
- release/*
- hotfix/*

pr:
- develop

jobs:
- job: Windows
pool:
vmImage: 'vs2017-win2016'
steps:
- powershell: ./build.ps1
displayName: 'Cake Build'
6 changes: 3 additions & 3 deletions nuspec/nuget/Cake.Issues.Testing.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
<description>
Common helpers for testing add-ins based on Cake.Issues
</description>
<licenseUrl>https://github.com/cake-contrib/Cake.Issues.Testing/blob/develop/LICENSE</licenseUrl>
<license type="expression">MIT</license>
<projectUrl>http://cake-contrib.github.io/Cake.Issues.Website/</projectUrl>
<iconUrl>https://cdn.rawgit.com/cake-contrib/graphics/a5cf0f881c390650144b2243ae551d5b9f836196/png/cake-contrib-medium.png</iconUrl>
<iconUrl>https://cdn.jsdelivr.net/gh/cake-contrib/graphics@a5cf0f881c390650144b2243ae551d5b9f836196/png/cake-contrib-medium.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<repository type="git" url="https://github.com/cake-contrib/Cake.Issues"/>
<copyright>Copyright © BBT Software AG and contributors</copyright>
<tags>Cake Script Cake-Issues Issues Testing</tags>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues/releases/tag/0.6.2</releaseNotes>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues/releases/tag/0.7.0</releaseNotes>
</metadata>
<files>
<file src="netstandard2.0\Cake.Issues.Testing.dll" target="lib\netstandard2.0" />
Expand Down
8 changes: 4 additions & 4 deletions nuspec/nuget/Cake.Issues.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ There are also additional addins for generating reports or posting issues to pul

See the Project Site for an overview of the whole ecosystem of addins for working with issues in Cake scripts.
</description>
<licenseUrl>https://github.com/cake-contrib/Cake.Issues/blob/develop/LICENSE</licenseUrl>
<license type="expression">MIT</license>
<projectUrl>http://cake-contrib.github.io/Cake.Issues.Website/</projectUrl>
<iconUrl>https://cdn.rawgit.com/cake-contrib/graphics/a5cf0f881c390650144b2243ae551d5b9f836196/png/cake-contrib-medium.png</iconUrl>
<iconUrl>https://cdn.jsdelivr.net/gh/cake-contrib/graphics@a5cf0f881c390650144b2243ae551d5b9f836196/png/cake-contrib-medium.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<repository type="git" url="https://github.com/cake-contrib/Cake.Issues"/>
<repository type="git" url="https://github.com/cake-contrib/Cake.Issues.git"/>
<copyright>Copyright © BBT Software AG and contributors</copyright>
<tags>Cake Script Cake-Issues CodeAnalysis Linting Issues</tags>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues/releases/tag/0.6.2</releaseNotes>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues/releases/tag/0.7.0</releaseNotes>
</metadata>
<files>
<file src="netstandard2.0\Cake.Issues.dll" target="lib\netstandard2.0" />
Expand Down
4 changes: 2 additions & 2 deletions setup.cake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#load nuget:https://www.myget.org/F/cake-contrib/api/v2?package=Cake.Recipe&prerelease
#load nuget:?package=Cake.Recipe&version=1.0.0

Environment.SetVariableNames();

Expand All @@ -17,7 +17,7 @@ BuildParameters.PrintParameters(Context);
ToolSettings.SetToolSettings(
context: Context,
dupFinderExcludePattern: new string[] { BuildParameters.RootDirectoryPath + "/src/Cake.Issues.Tests/*.cs", BuildParameters.RootDirectoryPath + "/src/Cake.Issues*/**/*.AssemblyInfo.cs" },
testCoverageFilter: "+[*]* -[xunit.*]* -[Cake.Core]* -[Cake.Testing]* -[*.Tests]* ",
testCoverageFilter: "+[*]* -[xunit.*]* -[Cake.Core]* -[Cake.Testing]* -[*.Tests]* -[Shouldly]*",
testCoverageExcludeByAttribute: "*.ExcludeFromCodeCoverage*",
testCoverageExcludeByFile: "*/*Designer.cs;*/*.g.cs;*/*.g.i.cs");

Expand Down
12 changes: 7 additions & 5 deletions src/Cake.Issues.Testing/Cake.Issues.Testing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Cake.Core" Version="0.28.0" />
<PackageReference Include="Cake.Testing" Version="0.28.0" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.6.1" />
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" />
<PackageReference Include="xunit.assert" Version="2.4.0" />
<PackageReference Include="Cake.Core" Version="0.33.0" />
<PackageReference Include="Cake.Testing" Version="0.33.0" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.2" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.1-rc.114">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down
55 changes: 46 additions & 9 deletions src/Cake.Issues.Testing/ExceptionAssertExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
namespace Cake.Issues.Testing
{
using System;
using Xunit;

/// <summary>
/// Extensions for asserting exceptions.
Expand All @@ -15,8 +14,12 @@ public static class ExceptionAssertExtensions
/// <param name="parameterName">Expected name of the parameter which has caused the exception.</param>
public static void IsArgumentException(this Exception exception, string parameterName)
{
Assert.IsType<ArgumentException>(exception);
Assert.Equal(parameterName, ((ArgumentException)exception).ParamName);
var argumentException = exception.CheckExceptionType<ArgumentException>();

if (argumentException.ParamName != parameterName)
{
throw new Exception($"Expected parameter name to be '{parameterName}' but was '{argumentException.ParamName}'.");
}
}

/// <summary>
Expand All @@ -26,8 +29,12 @@ public static void IsArgumentException(this Exception exception, string paramete
/// <param name="parameterName">Expected name of the parameter which has caused the exception.</param>
public static void IsArgumentNullException(this Exception exception, string parameterName)
{
Assert.IsType<ArgumentNullException>(exception);
Assert.Equal(parameterName, ((ArgumentNullException)exception).ParamName);
var argumentNullException = exception.CheckExceptionType<ArgumentNullException>();

if (argumentNullException.ParamName != parameterName)
{
throw new Exception($"Expected parameter name to be '{parameterName}' but was '{argumentNullException.ParamName}'.");
}
}

/// <summary>
Expand All @@ -37,8 +44,12 @@ public static void IsArgumentNullException(this Exception exception, string para
/// <param name="parameterName">Expected name of the parameter which has caused the exception.</param>
public static void IsArgumentOutOfRangeException(this Exception exception, string parameterName)
{
Assert.IsType<ArgumentOutOfRangeException>(exception);
Assert.Equal(parameterName, ((ArgumentOutOfRangeException)exception).ParamName);
var argumentOutOfRangeException = exception.CheckExceptionType<ArgumentOutOfRangeException>();

if (argumentOutOfRangeException.ParamName != parameterName)
{
throw new Exception($"Expected parameter name to be '{parameterName}' but was '{argumentOutOfRangeException.ParamName}'.");
}
}

/// <summary>
Expand All @@ -48,8 +59,34 @@ public static void IsArgumentOutOfRangeException(this Exception exception, strin
/// <param name="message">Expected exception message.</param>
public static void IsInvalidOperationException(this Exception exception, string message)
{
Assert.IsType<InvalidOperationException>(exception);
Assert.Equal(message, exception.Message);
var invalidOperationException = exception.CheckExceptionType<InvalidOperationException>();

if (invalidOperationException.Message != message)
{
throw new Exception($"Expected exception message to be '{message}' but was '{invalidOperationException.Message}'.");
}
}

/// <summary>
/// Validates and converts an exception type.
/// </summary>
/// <typeparam name="T">Type of expected exception.</typeparam>
/// <param name="exception">Exception which should be checked.</param>
/// <returns>Converted exception.</returns>
private static T CheckExceptionType<T>(this Exception exception)
where T : Exception
{
if (exception == null)
{
throw new Exception($"Expected exception of type '{typeof(T)}' but no exception was thrown.");
}

if (!(exception is T typedException))
{
throw new Exception($"Expected exception of type '{typeof(T)}' but was '{exception.GetType()}'.");
}

return typedException;
}
}
}
2 changes: 1 addition & 1 deletion src/Cake.Issues.Testing/FakeConfigurableIssueProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public FakeConfigurableIssueProvider(ICakeLog log, IssueProviderSettings setting
/// <summary>
/// Initializes a new instance of the <see cref="FakeConfigurableIssueProvider"/> class.
/// </summary>
/// <param name="log">The Cake log instance</param>
/// <param name="log">The Cake log instance.</param>
/// <param name="settings">The issue provider settings.</param>
/// <param name="issues">Issues which should be returned by the issue provider.</param>
public FakeConfigurableIssueProvider(
Expand Down
2 changes: 1 addition & 1 deletion src/Cake.Issues.Testing/FakeIssueComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class FakeIssueComponent : BaseIssueComponent<RepositorySettings>
/// <summary>
/// Initializes a new instance of the <see cref="FakeIssueComponent"/> class.
/// </summary>
/// <param name="log">The Cake log instance</param>
/// <param name="log">The Cake log instance.</param>
public FakeIssueComponent(ICakeLog log)
: base(log)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Cake.Issues.Testing/FakeIssueProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class FakeIssueProvider : BaseIssueProvider
/// <summary>
/// Initializes a new instance of the <see cref="FakeIssueProvider"/> class.
/// </summary>
/// <param name="log">The Cake log instance</param>
/// <param name="log">The Cake log instance.</param>
public FakeIssueProvider(ICakeLog log)
: base(log)
{
Expand All @@ -22,7 +22,7 @@ public FakeIssueProvider(ICakeLog log)
/// <summary>
/// Initializes a new instance of the <see cref="FakeIssueProvider"/> class.
/// </summary>
/// <param name="log">The Cake log instance</param>
/// <param name="log">The Cake log instance.</param>
/// <param name="issues">Issues which should be returned by the issue provider.</param>
public FakeIssueProvider(ICakeLog log, IEnumerable<IIssue> issues)
: base(log)
Expand Down
Loading

0 comments on commit bb85bee

Please sign in to comment.