Skip to content

Commit

Permalink
Fix StyleCop warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalberger committed Apr 19, 2019
1 parent 676293f commit ac862ab
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 41 deletions.
18 changes: 0 additions & 18 deletions src/Cake.Issues.Testing/ExceptionAssertExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,23 +78,5 @@ public static void IsInvalidOperationException(this Exception exception, string
throw new Exception($"Expected exception message to be '{message}' but was '{invalidOperationException.Message}'.");
}
}

///// <summary>
///// Checks if an execption is of type <see cref="XunitException"/>.
///// </summary>
///// <param name="exception">Exception to check.</param>
///// <param name="message">Expected exception message.</param>
//public static void IsXUnitException(this Exception exception, string message)
//{
// if (!(exception is XunitException xunitException))
// {
// throw new Exception($"Expected exception of type '{typeof(XunitException)}' but was '{exception.GetType()}'");
// }

// if (xunitException.Message.StartsWith(message))
// {
// throw new Exception($"Expected exception message to be '{message}' but was '{xunitException.Message}'.");
// }
//}
}
}
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
18 changes: 9 additions & 9 deletions src/Cake.Issues.Tests/IssueReaderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public void Should_Throw_If_Log_Is_Null()
// Given
var fixture = new IssuesFixture
{
Log = null
Log = null,
};

// When
Expand All @@ -32,7 +32,7 @@ public void Should_Throw_If_Issue_Provider_List_Is_Null()
// Given
var fixture = new IssuesFixture
{
IssueProviders = null
IssueProviders = null,
};

// When
Expand Down Expand Up @@ -77,7 +77,7 @@ public void Should_Throw_If_Settings_Are_Null()
// Given
var fixture = new IssuesFixture
{
Settings = null
Settings = null,
};

// When
Expand Down Expand Up @@ -125,7 +125,7 @@ public void Should_Initialize_All_Issue_Provider()
.InFile(@"src\Cake.Issues.Tests\FakeIssueProvider.cs", 12)
.OfRule("Bar")
.WithPriority(IssuePriority.Warning)
.Create()
.Create(),
}));
fixture.IssueProviders.Add(
new FakeIssueProvider(
Expand All @@ -143,7 +143,7 @@ public void Should_Initialize_All_Issue_Provider()
.InFile(@"src\Cake.Issues.Tests\Bar.cs", 7)
.OfRule("Bar")
.WithPriority(IssuePriority.Warning)
.Create()
.Create(),
}));

// When
Expand Down Expand Up @@ -179,7 +179,7 @@ public void Should_Read_Correct_Number_Of_Issues()
new List<IIssue>
{
issue1,
issue2
issue2,
}));

// When
Expand Down Expand Up @@ -215,7 +215,7 @@ public void Should_Read_Correct_Number_Of_Issues_Not_Related_To_A_File()
new List<IIssue>
{
issue1,
issue2
issue2,
}));

// When
Expand Down Expand Up @@ -267,15 +267,15 @@ public void Should_Read_Correct_Number_Of_Issues_From_Multiple_Providers()
new List<IIssue>
{
issue1,
issue2
issue2,
}));
fixture.IssueProviders.Add(
new FakeIssueProvider(
fixture.Log,
new List<IIssue>
{
issue3,
issue4
issue4,
}));

// When
Expand Down
2 changes: 1 addition & 1 deletion src/Cake.Issues.Tests/IssuesFixture.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace Cake.Issues.Tests
{
using System.Collections.Generic;
using Cake.Core.Diagnostics;
using Cake.Issues.Testing;
using Cake.Testing;
using Core.Diagnostics;

public class IssuesFixture
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public void Should_Throw_If_Log_Is_Null()
// Given
var fixture = new FakeConfigurableIssueProviderFixture("Build.log")
{
Log = null
Log = null,
};

// When
Expand All @@ -136,7 +136,7 @@ public void Should_Throw_If_RepositorySettings_Are_Null()
// Given
var fixture = new FakeConfigurableIssueProviderFixture("Build.log")
{
RepositorySettings = null
RepositorySettings = null,
};

// When
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void Should_Throw_If_Log_Is_Null()
// Given
var fixture = new FakeIssueProviderFixture
{
Log = null
Log = null,
};

// When
Expand All @@ -59,7 +59,7 @@ public void Should_Throw_If_RepositorySettings_Are_Null()
// Given
var fixture = new FakeIssueProviderFixture
{
RepositorySettings = null
RepositorySettings = null,
};

// When
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public void Should_Throw_If_Log_Is_Null()
// Given
var fixture = new FakeMultiFormatIssueProviderFixture("Build.log")
{
Log = null
Log = null,
};

// When
Expand All @@ -136,7 +136,7 @@ public void Should_Throw_If_RepositorySettings_Are_Null()
// Given
var fixture = new FakeMultiFormatIssueProviderFixture("Build.log")
{
RepositorySettings = null
RepositorySettings = null,
};

// When
Expand Down
2 changes: 1 addition & 1 deletion src/Cake.Issues/BaseIssueProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public IEnumerable<IIssue> ReadIssues(IssueCommentFormat format)
/// Compared to <see cref="ReadIssues"/> it is safe to access Settings from this method.
/// </summary>
/// <param name="format">Preferred format of the comments.</param>
/// <returns>List of issues</returns>
/// <returns>List of issues.</returns>
protected abstract IEnumerable<IIssue> InternalReadIssues(IssueCommentFormat format);
}
}
4 changes: 2 additions & 2 deletions src/Cake.Issues/BaseRuleUrlResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
/// <summary>
/// Base class for retrieving an URL linking to a site containing help for a rule.
/// </summary>
/// <typeparam name="T">Type of the rule description</typeparam>
/// <typeparam name="T">Type of the rule description.</typeparam>
public abstract class BaseRuleUrlResolver<T>
where T : BaseRuleDescription, new()
{
private readonly List<Tuple<Func<T, Uri>, int>> registeredUrlResolver = new List<Tuple<Func<T, Uri>, int>>();

/// <summary>
/// Registers a new resolver with default priority of <code>0</code>.
/// Registers a new resolver with default priority of <c>0</c>.
/// </summary>
/// <param name="resolver">Resolver which returns an <see cref="Uri"/> linking to a site
/// containing help for a specific <see cref="BaseRuleDescription"/>.</param>
Expand Down

0 comments on commit ac862ab

Please sign in to comment.