Skip to content

Commit 7567d7e

Browse files
chore(deps): Bump NetEvolve.Defaults from 1.3.74 to 1.3.80 (#123)
1 parent cef7dde commit 7567d7e

8 files changed

Lines changed: 27 additions & 77 deletions

File tree

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ indent_style = space
1111
trim_trailing_whitespace = true
1212
charset = utf-8
1313
end_of_line = lf
14+
max_line_length = 120
1415

1516
# Verify settings
1617
# https://github.com/VerifyTests/Verify?tab=readme-ov-file#text-file-settings

Directory.Packages.props

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@
99
<GlobalPackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.4" />
1010
<GlobalPackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0" />
1111
<GlobalPackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
12-
<GlobalPackageReference
13-
Include="Microsoft.VisualStudio.Threading.Analyzers"
14-
Version="17.13.61"
15-
/>
16-
<GlobalPackageReference Include="NetEvolve.Defaults" Version="1.3.74" />
12+
<GlobalPackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.13.61" />
13+
<GlobalPackageReference Include="NetEvolve.Defaults" Version="1.3.80" />
1714
<GlobalPackageReference
1815
Include="SonarAnalyzer.CSharp"
1916
Version="10.6.0.109712"

src/NetEvolve.FluentValue/Constraints/StartsWithConstraint.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ internal StartsWithConstraint(string compareValue, StringComparison comparison)
1919
public override bool IsSatisfiedBy(object? value) =>
2020
value switch
2121
{
22-
string stringValue when _compareValue is char compareValue => stringValue.StartsWith(
23-
compareValue
24-
),
22+
string stringValue when _compareValue is char compareValue => stringValue.StartsWith(compareValue),
2523
string stringValue when _compareValue is string compareValue => stringValue.StartsWith(
2624
compareValue,
2725
_comparison ?? default

src/NetEvolve.FluentValue/Constraints/WhiteSpaceConstraint.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ public override bool IsSatisfiedBy(object? value) =>
1212
_ => false,
1313
};
1414

15-
public override void SetDescription(StringBuilder builder) =>
16-
builder.Append(" is <whitespace>");
15+
public override void SetDescription(StringBuilder builder) => builder.Append(" is <whitespace>");
1716

1817
private static bool IsWhiteSpace(ReadOnlySpan<char> value)
1918
{

src/NetEvolve.FluentValue/IConstraint.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@
77
/// <summary>
88
/// Public interface for constraints, which can be used to build complex expressions.
99
/// </summary>
10-
[SuppressMessage(
11-
"Naming",
12-
"CA1716:Identifiers should not match keywords",
13-
Justification = "As designed."
14-
)]
10+
[SuppressMessage("Naming", "CA1716:Identifiers should not match keywords", Justification = "As designed.")]
1511
public interface IConstraint
1612
{
1713
/// <summary>

src/NetEvolve.FluentValue/IOperator.cs

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@
99
/// <summary>
1010
/// Public interface for operators, which can be used to build complex expressions.
1111
/// </summary>
12-
[SuppressMessage(
13-
"Naming",
14-
"CA1716:Identifiers should not match keywords",
15-
Justification = "As designed."
16-
)]
12+
[SuppressMessage("Naming", "CA1716:Identifiers should not match keywords", Justification = "As designed.")]
1713
public interface IOperator : IConstraint
1814
{
1915
/// <summary>
@@ -51,8 +47,7 @@ IConstraint Contains(char compareValue, StringComparison comparison = default) =
5147
/// <returns>
5248
/// The current instance.
5349
/// </returns>
54-
IConstraint Contains(object? compareValue) =>
55-
SetConstraint(new ContainsConstraint(compareValue));
50+
IConstraint Contains(object? compareValue) => SetConstraint(new ContainsConstraint(compareValue));
5651

5752
/// <summary>
5853
/// Appends a constraint that the value contains the specified string.
@@ -147,9 +142,7 @@ IConstraint Matches(
147142
#if NET7_0_OR_GREATER
148143
[StringSyntax(StringSyntaxAttribute.Regex)]
149144
#endif
150-
string pattern,
151-
RegexOptions? options = null
152-
) => SetConstraint(new MatchesConstraint(pattern, options));
145+
string pattern, RegexOptions? options = null) => SetConstraint(new MatchesConstraint(pattern, options));
153146

154147
/// <summary>
155148
/// Appends a negation operator.
@@ -186,8 +179,7 @@ IOperator Not
186179
/// <returns>
187180
/// The current instance.
188181
/// </returns>
189-
IConstraint Parenthesis(IConstraint constraint) =>
190-
SetConstraint(new ParenthesisConstraint(constraint));
182+
IConstraint Parenthesis(IConstraint constraint) => SetConstraint(new ParenthesisConstraint(constraint));
191183

192184
/// <summary>
193185
/// Appends a constraint that the value starts with the specified character.
@@ -198,8 +190,7 @@ IConstraint Parenthesis(IConstraint constraint) =>
198190
/// <returns>
199191
/// The current instance.
200192
/// </returns>
201-
IConstraint StartsWith(char compareValue) =>
202-
SetConstraint(new StartsWithConstraint(compareValue));
193+
IConstraint StartsWith(char compareValue) => SetConstraint(new StartsWithConstraint(compareValue));
203194

204195
/// <summary>
205196
/// Appends a constraint that the value starts with the specified string.

src/NetEvolve.FluentValue/Value.cs

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,8 @@ public static IConstraint Contains(char compareValue, StringComparison compariso
3737
/// <returns>
3838
/// The current instance.
3939
/// </returns>
40-
public static IConstraint Contains(
41-
string compareValue,
42-
StringComparison comparison = default
43-
) => new ContainsConstraint(compareValue, comparison);
40+
public static IConstraint Contains(string compareValue, StringComparison comparison = default) =>
41+
new ContainsConstraint(compareValue, comparison);
4442

4543
/// <summary>
4644
/// Appends a constraint that the value contains a <see langword="object"/>.
@@ -51,8 +49,7 @@ public static IConstraint Contains(
5149
/// <returns>
5250
/// The current instance.
5351
/// </returns>
54-
public static IConstraint Contains(object? compareValue) =>
55-
new ContainsConstraint(compareValue);
52+
public static IConstraint Contains(object? compareValue) => new ContainsConstraint(compareValue);
5653

5754
/// <summary>
5855
/// Appends a constraint that the value is the default value.
@@ -87,10 +84,8 @@ public static IConstraint Contains(object? compareValue) =>
8784
/// <returns>
8885
/// The current instance.
8986
/// </returns>
90-
public static IConstraint EndsWith(
91-
string compareValue,
92-
StringComparison comparison = default
93-
) => new EndsWithConstraint(compareValue, comparison);
87+
public static IConstraint EndsWith(string compareValue, StringComparison comparison = default) =>
88+
new EndsWithConstraint(compareValue, comparison);
9489

9590
/// <summary>
9691
/// Appends a constraint that the value is equal to the specified <see langword="object"/>.
@@ -132,9 +127,7 @@ public static IConstraint EqualTo(string compareValue, StringComparison comparis
132127
/// </returns>
133128
public static IConstraint Matches(
134129
#if NET7_0_OR_GREATER
135-
[System.Diagnostics.CodeAnalysis.StringSyntax(
136-
System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.Regex
137-
)]
130+
[System.Diagnostics.CodeAnalysis.StringSyntax(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.Regex)]
138131
#endif
139132
string pattern,
140133
RegexOptions? options = null
@@ -159,8 +152,7 @@ public static IConstraint Matches(
159152
/// <returns>
160153
/// The current instance.
161154
/// </returns>
162-
public static IConstraint Parenthesis(IConstraint constraint) =>
163-
new ParenthesisConstraint(constraint);
155+
public static IConstraint Parenthesis(IConstraint constraint) => new ParenthesisConstraint(constraint);
164156

165157
/// <summary>
166158
/// Appends a constraint that the value starts with the specified character.
@@ -171,8 +163,7 @@ public static IConstraint Parenthesis(IConstraint constraint) =>
171163
/// <returns>
172164
/// The current instance.
173165
/// </returns>
174-
public static IConstraint StartsWith(char compareValue) =>
175-
new StartsWithConstraint(compareValue);
166+
public static IConstraint StartsWith(char compareValue) => new StartsWithConstraint(compareValue);
176167

177168
/// <summary>
178169
/// Appends a constraint that the value starts with the specified string.
@@ -186,10 +177,8 @@ public static IConstraint StartsWith(char compareValue) =>
186177
/// <returns>
187178
/// The current instance.
188179
/// </returns>
189-
public static IConstraint StartsWith(
190-
string compareValue,
191-
StringComparison comparison = default
192-
) => new StartsWithConstraint(compareValue, comparison);
180+
public static IConstraint StartsWith(string compareValue, StringComparison comparison = default) =>
181+
new StartsWithConstraint(compareValue, comparison);
193182

194183
/// <summary>
195184
/// Appends a constraint that the value is a whitespace character.

tests/NetEvolve.FluentValue.Tests.Unit/ConstraintTests.cs

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ public void Value_MultipleOperators_ThrowsInvalidOperationException() =>
2929

3030
[Fact]
3131
public void Value_Contains_Object_ThrowsNotSupportedException() =>
32-
_ = Assert.Throws<NotSupportedException>(() =>
33-
Value.Contains(new object()).IsSatisfiedBy(new object())
34-
);
32+
_ = Assert.Throws<NotSupportedException>(() => Value.Contains(new object()).IsSatisfiedBy(new object()));
3533

3634
[Theory]
3735
[MemberData(nameof(InvalidConstraintData))]
@@ -149,33 +147,17 @@ public void Value_Theory_Expected(bool expected, IConstraint constraint, object?
149147
{ true, Value.WhiteSpace, '\n' },
150148
{ false, Value.WhiteSpace, 1 },
151149
// .And Operators
152-
{
153-
false,
154-
Value.Contains("Hello", OrdinalIgnoreCase).And.Contains("Welt!", Ordinal),
155-
"Hello World!"
156-
},
157-
{
158-
true,
159-
Value.Contains("Hello", OrdinalIgnoreCase).And.Contains("World!", Ordinal),
160-
"Hello World!"
161-
},
150+
{ false, Value.Contains("Hello", OrdinalIgnoreCase).And.Contains("Welt!", Ordinal), "Hello World!" },
151+
{ true, Value.Contains("Hello", OrdinalIgnoreCase).And.Contains("World!", Ordinal), "Hello World!" },
162152
// .Or Operators
163153
{ false, Value.Null.Or.Empty, "Hello World!" },
164154
{ true, Value.Null.Or.Empty, null },
165155
{ true, Value.Null.Or.Empty, string.Empty },
166156
// .Xor Operators
167157
{ false, Value.Null.Xor.Empty, "Hello World!" },
168158
{ true, Value.Null.Xor.Empty, string.Empty },
169-
{
170-
false,
171-
Value.Contains("Hello", OrdinalIgnoreCase).Xor.Contains("World!", Ordinal),
172-
"Hello World!"
173-
},
174-
{
175-
true,
176-
Value.Contains("Hello", OrdinalIgnoreCase).Xor.Not.Contains("World!", Ordinal),
177-
"Hello World!"
178-
},
159+
{ false, Value.Contains("Hello", OrdinalIgnoreCase).Xor.Contains("World!", Ordinal), "Hello World!" },
160+
{ true, Value.Contains("Hello", OrdinalIgnoreCase).Xor.Not.Contains("World!", Ordinal), "Hello World!" },
179161
// .Not Operators
180162
{ false, Value.Not.EqualTo(2), "2" },
181163
{ false, Value.Not.EqualTo("Hello World!"), "Hello World!" },
@@ -247,10 +229,7 @@ public void ToString_Theory_Expected(string expected, IConstraint constraint)
247229
// .WhiteSpace
248230
{ "\"{Value} is <whitespace>.\"", Value.WhiteSpace },
249231
// .And Operators
250-
{
251-
"\"{Value} contains `Hello` and contains `World!`.\"",
252-
Value.Contains("Hello").And.Contains("World!")
253-
},
232+
{ "\"{Value} contains `Hello` and contains `World!`.\"", Value.Contains("Hello").And.Contains("World!") },
254233
// .Or Operators
255234
{ "\"{Value} is <null> or is <empty>.\"", Value.Null.Or.Empty },
256235
// .Not.Null

0 commit comments

Comments
 (0)