Skip to content

Commit

Permalink
Merge pull request cake-contrib#136 from pascalberger/feature/cake-co…
Browse files Browse the repository at this point in the history
…ntribgh-118

(cake-contribGH-118) Rename to Cake.Issues.PullRequests.AzureDevOps
  • Loading branch information
pascalberger authored Oct 11, 2019
2 parents d5c1142 + 7f7da94 commit ea72585
Show file tree
Hide file tree
Showing 33 changed files with 405 additions and 416 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<RuleSet Name="Ruleset for Cake.Issues.PullRequests.Tfs test cases" Description="Rules valid for Cake.Issues.PullRequests.Tfs test cases" ToolsVersion="14.0">
<Include Path="Cake.Issues.PullRequests.Tfs.ruleset" Action="Default" />
<RuleSet Name="Ruleset for Cake.Issues.PullRequests.AzureDevOps test cases" Description="Rules valid for Cake.Issues.PullRequests.AzureDevOps test cases" ToolsVersion="14.0">
<Include Path="Cake.Issues.PullRequests.AzureDevOps.ruleset" Action="Default" />
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
<Rule Id="SA0001" Action="None" />
<Rule Id="SA1118" Action="None" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
namespace Cake.Issues.PullRequests.Tfs.Tests
namespace Cake.Issues.PullRequests.AzureDevOps.Tests
{
using System;
using Cake.Issues.Testing;
using Xunit;

public sealed class TfsPullRequestSystemSettingsTests
public sealed class AzureDevOpsPullRequestSystemSettingsTests
{
public sealed class TheCtor
{
[Fact]
public void Should_Throw_If_RepositoryUrl_For_SourceRefName_Is_Null()
{
// Given / When
var result = Record.Exception(() => new TfsPullRequestSystemSettings(null, "foo", null));
var result = Record.Exception(() => new AzureDevOpsPullRequestSystemSettings(null, "foo", null));

// Then
result.IsArgumentNullException("repositoryUrl");
Expand All @@ -22,7 +22,7 @@ public void Should_Throw_If_RepositoryUrl_For_SourceRefName_Is_Null()
public void Should_Throw_If_SourceRefName_Is_Null()
{
// Given / When
var result = Record.Exception(() => new TfsPullRequestSystemSettings(new Uri("http://example.com"), null, null));
var result = Record.Exception(() => new AzureDevOpsPullRequestSystemSettings(new Uri("http://example.com"), null, null));

// Then
result.IsArgumentNullException("sourceRefName");
Expand All @@ -32,7 +32,7 @@ public void Should_Throw_If_SourceRefName_Is_Null()
public void Should_Throw_If_SourceRefName_Is_Empty()
{
// Given / When
var result = Record.Exception(() => new TfsPullRequestSystemSettings(new Uri("http://example.com"), string.Empty, null));
var result = Record.Exception(() => new AzureDevOpsPullRequestSystemSettings(new Uri("http://example.com"), string.Empty, null));

// Then
result.IsArgumentOutOfRangeException("sourceRefName");
Expand All @@ -42,7 +42,7 @@ public void Should_Throw_If_SourceRefName_Is_Empty()
public void Should_Throw_If_SourceRefName_Is_WhiteSpace()
{
// Given / When
var result = Record.Exception(() => new TfsPullRequestSystemSettings(new Uri("http://example.com"), " ", null));
var result = Record.Exception(() => new AzureDevOpsPullRequestSystemSettings(new Uri("http://example.com"), " ", null));

// Then
result.IsArgumentOutOfRangeException("sourceRefName");
Expand All @@ -52,7 +52,7 @@ public void Should_Throw_If_SourceRefName_Is_WhiteSpace()
public void Should_Throw_If_RepositoryUrl_For_PullRequestId_Is_Null()
{
// Given / When
var result = Record.Exception(() => new TfsPullRequestSystemSettings(null, 0, null));
var result = Record.Exception(() => new AzureDevOpsPullRequestSystemSettings(null, 0, null));

// Then
result.IsArgumentNullException("repositoryUrl");
Expand All @@ -62,7 +62,7 @@ public void Should_Throw_If_RepositoryUrl_For_PullRequestId_Is_Null()
public void Should_Throw_If_Credentials_For_PullRequestId_Are_Null()
{
// Given / When
var result = Record.Exception(() => new TfsPullRequestSystemSettings(new Uri("http://example.com"), 42, null));
var result = Record.Exception(() => new AzureDevOpsPullRequestSystemSettings(new Uri("http://example.com"), 42, null));

// Then
result.IsArgumentNullException("credentials");
Expand All @@ -72,7 +72,7 @@ public void Should_Throw_If_Credentials_For_PullRequestId_Are_Null()
public void Should_Throw_If_Credentials_For_SourceBranch_Are_Null()
{
// Given / When
var result = Record.Exception(() => new TfsPullRequestSystemSettings(new Uri("http://example.com"), "feature/foo", null));
var result = Record.Exception(() => new AzureDevOpsPullRequestSystemSettings(new Uri("http://example.com"), "feature/foo", null));

// Then
result.IsArgumentNullException("credentials");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
namespace Cake.Issues.PullRequests.Tfs.Tests
namespace Cake.Issues.PullRequests.AzureDevOps.Tests
{
using System;
using Cake.AzureDevOps.Authentication;
using Cake.Core.Diagnostics;
using Cake.Issues.Testing;
using Cake.Testing;
using Cake.Tfs.Authentication;
using Xunit;

public sealed class TfsPullRequestSystemTests
public sealed class AzureDevOpsPullRequestSystemTests
{
public sealed class TheCtor
{
Expand All @@ -17,13 +17,13 @@ public void Should_Throw_If_Log_Is_Null()
// Given
ICakeLog log = null;
var settings =
new TfsPullRequestSystemSettings(
new AzureDevOpsPullRequestSystemSettings(
new Uri("https://google.com"),
123,
new TfsNtlmCredentials());
new AzureDevOpsNtlmCredentials());

// When
var result = Record.Exception(() => new TfsPullRequestSystem(log, settings));
var result = Record.Exception(() => new AzureDevOpsPullRequestSystem(log, settings));

// Then
result.IsArgumentNullException("log");
Expand All @@ -34,10 +34,10 @@ public void Should_Throw_If_Settings_Are_Null()
{
// Given
var log = new FakeLog();
TfsPullRequestSystemSettings settings = null;
AzureDevOpsPullRequestSystemSettings settings = null;

// When
var result = Record.Exception(() => new TfsPullRequestSystem(log, settings));
var result = Record.Exception(() => new AzureDevOpsPullRequestSystem(log, settings));

// Then
result.IsArgumentNullException("settings");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<PropertyGroup>
<TargetFrameworks>netcoreapp2.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<Product>Cake.Issues.PullRequests.Tfs</Product>
<Product>Cake.Issues.PullRequests.AzureDevOps</Product>
<Copyright>Copyright © BBT Software AG and contributors</Copyright>
<Description>Tests for the Cake.Issues.PullRequests.Tfs addin</Description>
<Description>Tests for the Cake.Issues.PullRequests.AzureDevOps addin</Description>
<Authors>BBT Software AG and contributors</Authors>
</PropertyGroup>

<PropertyGroup>
<CodeAnalysisRuleSet>..\Cake.Issues.PullRequests.Tfs.Tests.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet>..\Cake.Issues.PullRequests.AzureDevOps.Tests.ruleset</CodeAnalysisRuleSet>
<LangVersion>latest</LangVersion>
</PropertyGroup>

Expand All @@ -20,7 +20,7 @@
<PackageReference Include="Cake.Issues.PullRequests" Version="0.7.0" />
<PackageReference Include="Cake.Issues.Testing" Version="0.7.0" />
<PackageReference Include="Cake.Testing" Version="0.33.0" />
<PackageReference Include="Cake.Tfs" Version="0.3.1" />
<PackageReference Include="Cake.AzureDevOps" Version="0.4.0-beta0001" />
<PackageReference Include="NSubstitute" Version="4.2.1" />
<PackageReference Include="Shouldly" Version="3.0.2" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" />
Expand All @@ -29,7 +29,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Cake.Issues.PullRequests.Tfs\Cake.Issues.PullRequests.Tfs.csproj" />
<ProjectReference Include="..\Cake.Issues.PullRequests.AzureDevOps\Cake.Issues.PullRequests.AzureDevOps.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
namespace Cake.Issues.PullRequests.Tfs.Tests.Capabilities
namespace Cake.Issues.PullRequests.AzureDevOps.Tests.Capabilities
{
using Cake.Core.Diagnostics;
using Cake.Issues.PullRequests.Tfs.Capabilities;
using Cake.Issues.PullRequests.AzureDevOps.Capabilities;
using Cake.Issues.Testing;
using Cake.Testing;
using NSubstitute;
using Xunit;

public sealed class TfsFilteringByModifiedFilesCapabilityTests
public sealed class AzureDevOpsCheckingCommitIdCapabilityTests
{
public sealed class TheCtor
{
Expand All @@ -16,10 +16,10 @@ public void Should_Throw_If_Log_Is_Null()
{
// Given
ICakeLog log = null;
var pullRequestSystem = Substitute.For<ITfsPullRequestSystem>();
var pullRequestSystem = Substitute.For<IAzureDevOpsPullRequestSystem>();

// When
var result = Record.Exception(() => new TfsFilteringByModifiedFilesCapability(log, pullRequestSystem));
var result = Record.Exception(() => new AzureDevOpsCheckingCommitIdCapability(log, pullRequestSystem));

// Then
result.IsArgumentNullException("log");
Expand All @@ -30,10 +30,10 @@ public void Should_Throw_If_PullRequestSystem_Is_Null()
{
// Given
var log = new FakeLog();
TfsPullRequestSystem pullRequestSystem = null;
AzureDevOpsPullRequestSystem pullRequestSystem = null;

// When
var result = Record.Exception(() => new TfsFilteringByModifiedFilesCapability(log, pullRequestSystem));
var result = Record.Exception(() => new AzureDevOpsCheckingCommitIdCapability(log, pullRequestSystem));

// Then
result.IsArgumentNullException("pullRequestSystem");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
namespace Cake.Issues.PullRequests.Tfs.Tests.Capabilities
namespace Cake.Issues.PullRequests.AzureDevOps.Tests.Capabilities
{
using Cake.Core.Diagnostics;
using Cake.Issues.PullRequests.Tfs.Capabilities;
using Cake.Issues.PullRequests.AzureDevOps.Capabilities;
using Cake.Issues.Testing;
using Cake.Testing;
using NSubstitute;
using Xunit;

public sealed class TfsDiscussionThreadsCapabilityTests
public sealed class AzureDevOpsDiscussionThreadsCapabilityTests
{
public sealed class TheCtor
{
Expand All @@ -16,10 +16,10 @@ public void Should_Throw_If_Log_Is_Null()
{
// Given
ICakeLog log = null;
var pullRequestSystem = Substitute.For<ITfsPullRequestSystem>();
var pullRequestSystem = Substitute.For<IAzureDevOpsPullRequestSystem>();

// When
var result = Record.Exception(() => new TfsDiscussionThreadsCapability(log, pullRequestSystem));
var result = Record.Exception(() => new AzureDevOpsDiscussionThreadsCapability(log, pullRequestSystem));

// Then
result.IsArgumentNullException("log");
Expand All @@ -30,10 +30,10 @@ public void Should_Throw_If_PullRequestSystem_Is_Null()
{
// Given
var log = new FakeLog();
TfsPullRequestSystem pullRequestSystem = null;
AzureDevOpsPullRequestSystem pullRequestSystem = null;

// When
var result = Record.Exception(() => new TfsDiscussionThreadsCapability(log, pullRequestSystem));
var result = Record.Exception(() => new AzureDevOpsDiscussionThreadsCapability(log, pullRequestSystem));

// Then
result.IsArgumentNullException("pullRequestSystem");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
namespace Cake.Issues.PullRequests.Tfs.Tests.Capabilities
namespace Cake.Issues.PullRequests.AzureDevOps.Tests.Capabilities
{
using Cake.Core.Diagnostics;
using Cake.Issues.PullRequests.Tfs.Capabilities;
using Cake.Issues.PullRequests.AzureDevOps.Capabilities;
using Cake.Issues.Testing;
using Cake.Testing;
using NSubstitute;
using Xunit;

public sealed class TfsCheckingCommitIdCapabilityTests
public sealed class AzureDevOpsFilteringByModifiedFilesCapabilityTests
{
public sealed class TheCtor
{
Expand All @@ -16,10 +16,10 @@ public void Should_Throw_If_Log_Is_Null()
{
// Given
ICakeLog log = null;
var pullRequestSystem = Substitute.For<ITfsPullRequestSystem>();
var pullRequestSystem = Substitute.For<IAzureDevOpsPullRequestSystem>();

// When
var result = Record.Exception(() => new TfsCheckingCommitIdCapability(log, pullRequestSystem));
var result = Record.Exception(() => new AzureDevOpsFilteringByModifiedFilesCapability(log, pullRequestSystem));

// Then
result.IsArgumentNullException("log");
Expand All @@ -30,10 +30,10 @@ public void Should_Throw_If_PullRequestSystem_Is_Null()
{
// Given
var log = new FakeLog();
TfsPullRequestSystem pullRequestSystem = null;
AzureDevOpsPullRequestSystem pullRequestSystem = null;

// When
var result = Record.Exception(() => new TfsCheckingCommitIdCapability(log, pullRequestSystem));
var result = Record.Exception(() => new AzureDevOpsFilteringByModifiedFilesCapability(log, pullRequestSystem));

// Then
result.IsArgumentNullException("pullRequestSystem");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace Cake.Issues.PullRequests.Tfs.Tests.Capabilities
namespace Cake.Issues.PullRequests.AzureDevOps.Tests.Capabilities
{
using Cake.Issues.PullRequests.Tfs.Capabilities;
using Cake.AzureDevOps.PullRequest.CommentThread;
using Cake.Issues.PullRequests.AzureDevOps.Capabilities;
using Cake.Issues.Testing;
using Cake.Tfs.PullRequest.CommentThread;
using Shouldly;
using Xunit;

Expand All @@ -14,7 +14,7 @@ public sealed class TheToPullRequestDiscussionCommentExtension
public void Should_Throw_If_Comment_Is_Null()
{
// Given
TfsComment comment = null;
AzureDevOpsComment comment = null;

// When
var result = Record.Exception(() => comment.ToPullRequestDiscussionComment());
Expand All @@ -29,7 +29,7 @@ public void Should_Set_Correct_Content()
// Given
var content = "foo";
var comment =
new TfsComment
new AzureDevOpsComment
{
Content = content,
};
Expand All @@ -48,7 +48,7 @@ public void Should_Set_Correct_IsDeleted(bool isDeleted)
{
// Given
var comment =
new TfsComment
new AzureDevOpsComment
{
IsDeleted = isDeleted,
};
Expand Down
Loading

0 comments on commit ea72585

Please sign in to comment.