Skip to content

Commit 46915a0

Browse files
committed
Merge branch 'release/0.4.1'
2 parents d8961a3 + b5827f3 commit 46915a0

File tree

14 files changed

+197
-62
lines changed

14 files changed

+197
-62
lines changed

.appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#---------------------------------#
22
# Build Image #
33
#---------------------------------#
4-
image: Visual Studio 2017
4+
image: Visual Studio 2019
55

66
#---------------------------------#
77
# Build Script #
@@ -27,4 +27,4 @@ branches:
2727
# Build Cache #
2828
#---------------------------------#
2929
cache:
30-
- tools -> setup.cake
30+
- tools -> recipe.cake

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These owners will be the default owners for everything in the repo and
2+
# will be requested for review when someone opens a pull request.
3+
* @pascalberger

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,9 @@ __pycache__/
302302

303303
# End of https://www.gitignore.io/api/cake,visualstudio
304304

305-
# Project specific
305+
# Project specific
306306

307307
BuildArtifacts/
308-
config.wyam.*
308+
config.wyam.*
309+
310+
.dotnet

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Click on the build server and repository links to see the build definition or so
3838

3939
## Chat Room
4040

41-
Come join in the conversation about this addin in our Gitter Chat Room
41+
Come join in the conversation about this addin in our Gitter Chat Room.
4242

4343
[![Join the chat at https://gitter.im/cake-contrib/Lobby](https://badges.gitter.im/cake-contrib/Lobby.svg)](https://gitter.im/cake-contrib/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
4444

build.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ http://cakebuild.net
3535

3636
[CmdletBinding()]
3737
Param(
38-
[string]$Script = "setup.cake",
38+
[string]$Script = "recipe.cake",
3939
[string]$Target = "Default",
4040
[ValidateSet("Release", "Debug")]
4141
[string]$Configuration = "Release",
@@ -181,4 +181,4 @@ if (!(Test-Path $CAKE_EXE)) {
181181
# Start Cake
182182
Write-Host "Running build script..."
183183
Invoke-Expression "& `"$CAKE_EXE`" `"$Script`" -target=`"$Target`" -configuration=`"$Configuration`" -verbosity=`"$Verbosity`" $UseMono $UseDryRun $UseExperimental $ScriptArgs"
184-
exit $LASTEXITCODE
184+
exit $LASTEXITCODE

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,4 @@ fi
9999
###########################################################################
100100

101101
# Start Cake
102-
exec mono "$CAKE_EXE" setup.cake --verbosity=$VERBOSITY --configuration=$CONFIGURATION --target=$TARGET $DRYRUN "${SCRIPT_ARGUMENTS[@]}"
102+
exec mono "$CAKE_EXE" recipe.cake --verbosity=$VERBOSITY --configuration=$CONFIGURATION --target=$TARGET $DRYRUN "${SCRIPT_ARGUMENTS[@]}"

setup.cake renamed to recipe.cake

File renamed without changes.

src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp2.0</TargetFrameworks>
4+
<TargetFrameworks>netcoreapp2.1</TargetFrameworks>
55
<IsPackable>false</IsPackable>
66
<Product>Cake.AzureDevOps</Product>
77
<Copyright>Copyright © Pascal Berger</Copyright>
@@ -14,11 +14,11 @@
1414
</PropertyGroup>
1515

1616
<ItemGroup>
17-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
17+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
1818
<PackageReference Include="Cake.Core" Version="0.33.0" />
1919
<PackageReference Include="Cake.Testing" Version="0.33.0" />
2020
<PackageReference Include="Microsoft.TeamFoundationServer.Client" Version="16.143.2" />
21-
<PackageReference Include="Moq" Version="4.12.0" />
21+
<PackageReference Include="Moq" Version="4.13.0" />
2222
<PackageReference Include="Shouldly" Version="3.0.2" />
2323
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" />
2424
<PackageReference Include="xunit" Version="2.4.1" />

src/Cake.AzureDevOps.Tests/PullRequest/AzureDevOpsPullRequestTests.cs

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,68 @@ public void Should_Return_Valid_Comment_Threads()
766766
}
767767
}
768768

769+
public sealed class TheCreateCommentMethod
770+
{
771+
[Fact]
772+
public void Should_Throw_If_Comment_Is_Null()
773+
{
774+
// Given
775+
var fixture = new PullRequestFixture(BasePullRequestFixture.ValidAzureDevOpsServerUrl, 100);
776+
var pullRequest = new AzureDevOpsPullRequest(fixture.Log, fixture.Settings, fixture.GitClientFactory);
777+
778+
// When
779+
var result = Record.Exception(() => pullRequest.CreateComment(null));
780+
781+
// Then
782+
result.IsArgumentNullException("comment");
783+
}
784+
785+
[Fact]
786+
public void Should_Throw_If_Comment_Is_Empty()
787+
{
788+
// Given
789+
var fixture = new PullRequestFixture(BasePullRequestFixture.ValidAzureDevOpsServerUrl, 100);
790+
var pullRequest = new AzureDevOpsPullRequest(fixture.Log, fixture.Settings, fixture.GitClientFactory);
791+
792+
// When
793+
var result = Record.Exception(() => pullRequest.CreateComment(string.Empty));
794+
795+
// Then
796+
result.IsArgumentOutOfRangeException("comment");
797+
}
798+
799+
[Fact]
800+
public void Should_Throw_If_Comment_Is_Whitespace()
801+
{
802+
// Given
803+
var fixture = new PullRequestFixture(BasePullRequestFixture.ValidAzureDevOpsServerUrl, 100);
804+
var pullRequest = new AzureDevOpsPullRequest(fixture.Log, fixture.Settings, fixture.GitClientFactory);
805+
806+
// When
807+
var result = Record.Exception(() => pullRequest.CreateComment(" "));
808+
809+
// Then
810+
result.IsArgumentOutOfRangeException("comment");
811+
}
812+
813+
[Fact]
814+
public void Should_Not_Throw_If_Null_Is_Returned()
815+
{
816+
// Given
817+
var fixture = new PullRequestFixture(BasePullRequestFixture.ValidAzureDevOpsServerUrl, 100)
818+
{
819+
GitClientFactory = new FakeNullForMethodsGitClientFactory(),
820+
};
821+
var pullRequest = new AzureDevOpsPullRequest(fixture.Log, fixture.Settings, fixture.GitClientFactory);
822+
823+
// When
824+
pullRequest.CreateComment("Foo");
825+
826+
// Then
827+
// ?? Nothing to validate here since the method returns void
828+
}
829+
}
830+
769831
public sealed class TheCreateCommentThreadMethod
770832
{
771833
[Fact]
@@ -779,7 +841,7 @@ public void Should_Throw_If_Input_Thread_Is_Null()
779841
var result = Record.Exception(() => pullRequest.CreateCommentThread(null));
780842

781843
// Then
782-
Assert.IsType<NullReferenceException>(result);
844+
result.IsArgumentNullException("thread");
783845
}
784846

785847
[Fact]

src/Cake.AzureDevOps.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cake.AzureDevOps.Tests", "C
99
EndProject
1010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{E086EBC9-C1E6-4B49-AFFB-B3F6340886BA}"
1111
ProjectSection(SolutionItems) = preProject
12-
..\setup.cake = ..\setup.cake
12+
..\recipe.cake = ..\recipe.cake
1313
EndProjectSection
1414
EndProject
1515
Global

0 commit comments

Comments
 (0)