Skip to content

Commit

Permalink
Bump Roslynator.Analyzers from 4.12.0 to 4.12.3 (#2643)
Browse files Browse the repository at this point in the history
* Bump Roslynator.Analyzers from 4.12.0 to 4.12.3

Bumps [Roslynator.Analyzers](https://github.com/dotnet/roslynator) from 4.12.0 to 4.12.3.
- [Release notes](https://github.com/dotnet/roslynator/releases)
- [Changelog](https://github.com/dotnet/roslynator/blob/main/ChangeLog.md)
- [Commits](dotnet/roslynator@v4.12.0...v4.12.3)

---
updated-dependencies:
- dependency-name: Roslynator.Analyzers
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Use element access over LINQ

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jonas Nyrup <jnyrup@gmail.com>
  • Loading branch information
dependabot[bot] and jnyrup committed May 14, 2024
1 parent 7aa57b3 commit 019389c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Roslynator.Analyzers" Version="4.12.0">
<PackageReference Include="Roslynator.Analyzers" Version="4.12.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using FluentAssertions.Execution;
using Xunit;
Expand Down Expand Up @@ -351,7 +350,7 @@ public void When_strings_are_in_ascending_order_according_to_a_custom_lambda_it_
string[] strings = ["alpha", "beta", "theta"];

// Act
Action act = () => strings.Should().BeInAscendingOrder((sut, exp) => sut.Last().CompareTo(exp.Last()));
Action act = () => strings.Should().BeInAscendingOrder((sut, exp) => sut[^1].CompareTo(exp[^1]));

// Assert
act.Should().NotThrow();
Expand All @@ -365,7 +364,7 @@ public void When_strings_are_not_in_ascending_order_according_to_a_custom_lambda

// Act
Action act = () =>
strings.Should().BeInAscendingOrder((sut, exp) => sut.Last().CompareTo(exp.Last()), "of {0}", "reasons");
strings.Should().BeInAscendingOrder((sut, exp) => sut[^1].CompareTo(exp[^1]), "of {0}", "reasons");

// Assert
act.Should()
Expand Down Expand Up @@ -761,7 +760,7 @@ public void When_strings_are_not_in_ascending_order_according_to_a_custom_lambda
string[] strings = ["roy", "dennis", "thomas"];

// Act
Action act = () => strings.Should().NotBeInAscendingOrder((sut, exp) => sut.Last().CompareTo(exp.Last()));
Action act = () => strings.Should().NotBeInAscendingOrder((sut, exp) => sut[^1].CompareTo(exp[^1]));

// Assert
act.Should().NotThrow();
Expand All @@ -775,7 +774,7 @@ public void When_strings_are_unexpectedly_in_ascending_order_according_to_a_cust

// Act
Action act = () =>
strings.Should().NotBeInAscendingOrder((sut, exp) => sut.Last().CompareTo(exp.Last()), "of {0}", "reasons");
strings.Should().NotBeInAscendingOrder((sut, exp) => sut[^1].CompareTo(exp[^1]), "of {0}", "reasons");

// Assert
act.Should()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Xunit;
using Xunit.Sdk;

Expand Down Expand Up @@ -263,7 +262,7 @@ public void When_strings_are_in_descending_order_based_on_a_custom_lambda_it_sho
string[] strings = ["roy", "dennis", "barbara"];

// Act
Action act = () => strings.Should().BeInDescendingOrder((sut, exp) => sut.Last().CompareTo(exp.Last()));
Action act = () => strings.Should().BeInDescendingOrder((sut, exp) => sut[^1].CompareTo(exp[^1]));

// Assert
act.Should().NotThrow();
Expand All @@ -277,7 +276,7 @@ public void When_strings_are_not_in_descending_order_based_on_a_custom_lambda_it

// Act
Action act = () =>
strings.Should().BeInDescendingOrder((sut, exp) => sut.Last().CompareTo(exp.Last()), "of {0}", "reasons");
strings.Should().BeInDescendingOrder((sut, exp) => sut[^1].CompareTo(exp[^1]), "of {0}", "reasons");

// Assert
act.Should()
Expand Down Expand Up @@ -572,7 +571,7 @@ public void When_strings_are_not_in_descending_order_based_on_a_custom_lambda_it
string[] strings = ["dennis", "roy", "barbara"];

// Act
Action act = () => strings.Should().NotBeInDescendingOrder((sut, exp) => sut.Last().CompareTo(exp.Last()));
Action act = () => strings.Should().NotBeInDescendingOrder((sut, exp) => sut[^1].CompareTo(exp[^1]));

// Assert
act.Should().NotThrow();
Expand All @@ -586,7 +585,7 @@ public void When_strings_are_unexpectedly_in_descending_order_based_on_a_custom_

// Act
Action act = () =>
strings.Should().NotBeInDescendingOrder((sut, exp) => sut.Last().CompareTo(exp.Last()), "of {0}", "reasons");
strings.Should().NotBeInDescendingOrder((sut, exp) => sut[^1].CompareTo(exp[^1]), "of {0}", "reasons");

// Assert
act.Should()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ private class ByLastCharacterComparer : IComparer<string>
{
public int Compare(string x, string y)
{
return x.Last().CompareTo(y.Last());
return x[^1].CompareTo(y[^1]);

Check warning on line 221 in Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.cs

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Possible 'System.NullReferenceException'

Possible 'System.NullReferenceException'

Check warning on line 221 in Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.cs

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Possible 'System.NullReferenceException'

Possible 'System.NullReferenceException'
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/FluentAssertions.Specs/Events/EventAssertionSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ public void When_constraints_are_specified_it_should_filter_the_events_based_on_

recording
.Should().ContainSingle("because we were expecting a specific property change")
.Which.Parameters.Last().Should().BeOfType<PropertyChangedEventArgs>()
.Which.Parameters[^1].Should().BeOfType<PropertyChangedEventArgs>()
.Which.PropertyName.Should().Be("Boo");
}

Expand Down

0 comments on commit 019389c

Please sign in to comment.