Skip to content

Commit fb9505c

Browse files
authored
Merge pull request #224 from Joy-less/update-packages
Update packages & migrate to Shouldly
2 parents f1831e7 + 9804551 commit fb9505c

13 files changed

+129
-129
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<ItemGroup>
4-
<PackageReference Include="SonarAnalyzer.CSharp" Version="10.4.0.108396">
4+
<PackageReference Include="SonarAnalyzer.CSharp" Version="10.5.0.109200">
55
<PrivateAssets>all</PrivateAssets>
66
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
77
</PackageReference>

src/LinkDotNet.StringBuilder/LinkDotNet.StringBuilder.csproj

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

33
<PropertyGroup>
44
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
@@ -33,16 +33,16 @@
3333
</None>
3434
</ItemGroup>
3535

36-
<PropertyGroup Label="Analyzer settings">
37-
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
38-
<EnableNETAnalyzers>true</EnableNETAnalyzers>
39-
<AnalysisLevel>8</AnalysisLevel>
40-
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
41-
<PackageLicenseExpression>MIT</PackageLicenseExpression>
42-
</PropertyGroup>
36+
<PropertyGroup Label="Analyzer settings">
37+
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
38+
<EnableNETAnalyzers>true</EnableNETAnalyzers>
39+
<AnalysisLevel>8</AnalysisLevel>
40+
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
41+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
42+
</PropertyGroup>
4343

4444
<ItemGroup>
45-
<PackageReference Include="Meziantou.Analyzer" Version="2.0.184">
45+
<PackageReference Include="Meziantou.Analyzer" Version="2.0.186">
4646
<PrivateAssets>all</PrivateAssets>
4747
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
4848
</PackageReference>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
@@ -9,11 +9,11 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" />
12+
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" />
1313
</ItemGroup>
1414

1515
<ItemGroup>
16-
<ProjectReference Include="..\..\src\LinkDotNet.StringBuilder\LinkDotNet.StringBuilder.csproj" />
16+
<ProjectReference Include="..\..\src\LinkDotNet.StringBuilder\LinkDotNet.StringBuilder.csproj" />
1717
</ItemGroup>
1818

1919
</Project>

tests/LinkDotNet.StringBuilder.UnitTests/LinkDotNet.StringBuilder.UnitTests.csproj

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

33
<PropertyGroup>
44
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
@@ -8,25 +8,25 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="FluentAssertions" Version="7.0.0" />
1211
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
13-
<PackageReference Include="xunit.v3" Version="1.0.0" />
14-
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0">
12+
<PackageReference Include="Shouldly" Version="4.3.0" />
13+
<PackageReference Include="xunit.v3" Version="1.0.1" />
14+
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.1">
1515
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1616
<PrivateAssets>all</PrivateAssets>
1717
</PackageReference>
18-
<PackageReference Include="coverlet.collector" Version="6.0.3">
18+
<PackageReference Include="coverlet.collector" Version="6.0.4">
1919
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2020
<PrivateAssets>all</PrivateAssets>
2121
</PackageReference>
2222
</ItemGroup>
2323

2424
<ItemGroup>
25-
<ProjectReference Include="..\..\src\LinkDotNet.StringBuilder\LinkDotNet.StringBuilder.csproj" />
25+
<ProjectReference Include="..\..\src\LinkDotNet.StringBuilder\LinkDotNet.StringBuilder.csproj" />
2626
</ItemGroup>
2727

2828
<ItemGroup Label="Global usings">
29-
<Using Include="FluentAssertions" />
29+
<Using Include="Shouldly" />
3030
<Using Include="Xunit" />
3131
</ItemGroup>
3232

tests/LinkDotNet.StringBuilder.UnitTests/ValueStringBuilder.Append.Tests.cs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public void ShouldAddString()
1111

1212
stringBuilder.Append("That is a string");
1313

14-
stringBuilder.ToString().Should().Be("That is a string");
14+
stringBuilder.ToString().ShouldBe("That is a string");
1515
}
1616

1717
[Fact]
@@ -24,7 +24,7 @@ public void ShouldAddMultipleStrings()
2424
stringBuilder.Append("a");
2525
stringBuilder.Append("test");
2626

27-
stringBuilder.ToString().Should().Be("Thisisatest");
27+
stringBuilder.ToString().ShouldBe("Thisisatest");
2828
}
2929

3030
[Fact]
@@ -34,7 +34,7 @@ public void ShouldAddLargeStrings()
3434

3535
stringBuilder.Append(new string('c', 99));
3636

37-
stringBuilder.ToString().Should().MatchRegex("[c]{99}");
37+
stringBuilder.ToString().ShouldMatch("[c]{99}");
3838
}
3939

4040
[Fact]
@@ -44,7 +44,7 @@ public void ShouldAppendLine()
4444

4545
stringBuilder.AppendLine("Hello");
4646

47-
stringBuilder.ToString().Should().Contain("Hello").And.Contain(Environment.NewLine);
47+
stringBuilder.ToString().ShouldContain("Hello" + Environment.NewLine);
4848
}
4949

5050
[Fact]
@@ -54,9 +54,9 @@ public void ShouldAppendSpan()
5454

5555
var returned = stringBuilder.AppendSpan(2);
5656

57-
stringBuilder.Length.Should().Be(2);
57+
stringBuilder.Length.ShouldBe(2);
5858

59-
stringBuilder.ToString().Should().Be(returned.ToString());
59+
stringBuilder.ToString().ShouldBe(returned.ToString());
6060
}
6161

6262
[Fact]
@@ -66,7 +66,7 @@ public void ShouldOnlyAddNewline()
6666

6767
stringBuilder.AppendLine();
6868

69-
stringBuilder.ToString().Should().Be(Environment.NewLine);
69+
stringBuilder.ToString().ShouldBe(Environment.NewLine);
7070
}
7171

7272
[Fact]
@@ -76,7 +76,7 @@ public void ShouldGetIndexIfGiven()
7676

7777
stringBuilder.Append("Hello");
7878

79-
stringBuilder[2].Should().Be('l');
79+
stringBuilder[2].ShouldBe('l');
8080
}
8181

8282
[Fact]
@@ -86,7 +86,7 @@ public void ShouldAppendSpanFormattable()
8686

8787
builder.Append(2.2f);
8888

89-
builder.ToString().Should().Be("2.2");
89+
builder.ToString().ShouldBe("2.2");
9090
}
9191

9292
[Fact]
@@ -99,7 +99,7 @@ public void ShouldAppendMultipleChars()
9999
builder.Append('c');
100100
}
101101

102-
builder.ToString().Should().MatchRegex("[c]{64}");
102+
builder.ToString().ShouldMatch("[c]{64}");
103103
}
104104

105105
[Fact]
@@ -111,7 +111,7 @@ public void ShouldAppendMultipleDoubles()
111111
builder.Append(1d / 3d);
112112
builder.Append(1d / 3d);
113113

114-
builder.ToString().Should().Be("0.33333333333333330.33333333333333330.3333333333333333");
114+
builder.ToString().ShouldBe("0.33333333333333330.33333333333333330.3333333333333333");
115115
}
116116

117117
[Fact]
@@ -121,7 +121,7 @@ public void ShouldAppendGuid()
121121

122122
builder.Append(Guid.Empty);
123123

124-
builder.ToString().Should().Be("00000000-0000-0000-0000-000000000000");
124+
builder.ToString().ShouldBe("00000000-0000-0000-0000-000000000000");
125125
}
126126

127127
[Fact]
@@ -151,7 +151,7 @@ public void ShouldAppendBoolean(bool value, string expected)
151151

152152
builder.Append(value);
153153

154-
builder.ToString().Should().Be(expected);
154+
builder.ToString().ShouldBe(expected);
155155
}
156156

157157
[Fact]
@@ -165,7 +165,7 @@ public unsafe void ShouldAddCharPointer()
165165
builder.Append(pText, 5);
166166
}
167167

168-
builder.ToString().Should().Be("Hello");
168+
builder.ToString().ShouldBe("Hello");
169169
}
170170

171171
[Fact]
@@ -178,7 +178,7 @@ public void GivenMemorySlice_ShouldAppend()
178178

179179
builder.Append(slice);
180180

181-
builder.ToString().Should().Be("ccccc");
181+
builder.ToString().ShouldBe("ccccc");
182182
}
183183

184184
[Fact]
@@ -189,7 +189,7 @@ public void GivenAStringWithWhitespace_WhenTrimIsCalled_ThenTheStringShouldBeTri
189189

190190
builder.Trim();
191191

192-
builder.ToString().Should().Be("Hello World");
192+
builder.ToString().ShouldBe("Hello World");
193193
}
194194

195195
[Fact]
@@ -206,7 +206,7 @@ public void GivenMultipleValues_WhenCallingAppend_NotCrashing()
206206

207207
builder.Append(false);
208208

209-
builder.ToString().Should().NotBeNull();
209+
builder.ToString().ShouldNotBeNull();
210210
}
211211

212212
[Fact]
@@ -215,7 +215,7 @@ public void GivenStringBuilder_WhenAddingSingleCharacter_ThenShouldBeAdded()
215215
using var builder = new ValueStringBuilder();
216216
builder.Append('c');
217217

218-
builder.ToString().Should().Be("c");
218+
builder.ToString().ShouldBe("c");
219219
}
220220

221221
[Fact]
@@ -229,6 +229,6 @@ public void GivenStringBuilder_WhenAddingIncreasinglyLargerStrings_ThenShouldBeA
229229
builder.Append(new string('e', 4096));
230230
builder.Append(new string('f', 8192));
231231

232-
builder.ToString().Should().MatchRegex("[a]{256}[b]{512}[c]{1024}[d]{2048}[e]{4096}[f]{8192}");
232+
builder.ToString().ShouldMatch("[a]{256}[b]{512}[c]{1024}[d]{2048}[e]{4096}[f]{8192}");
233233
}
234234
}

tests/LinkDotNet.StringBuilder.UnitTests/ValueStringBuilder.AppendFormat.Tests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public void ShouldAppendFormatWithOneArgument(string format, object arg, string
1515

1616
builder.AppendFormat(format, arg);
1717

18-
builder.ToString().Should().Be(expected);
18+
builder.ToString().ShouldBe(expected);
1919
}
2020

2121
[Theory]
@@ -50,7 +50,7 @@ public void ShouldAppendFormatWithTwoArguments(string format, object arg1, objec
5050

5151
builder.AppendFormat(format, arg1, arg2);
5252

53-
builder.ToString().Should().Be(expected);
53+
builder.ToString().ShouldBe(expected);
5454
}
5555

5656
[Theory]
@@ -64,7 +64,7 @@ public void ShouldAppendFormatWithThreeArguments(string format, object arg1, obj
6464

6565
builder.AppendFormat(format, arg1, arg2, arg3);
6666

67-
builder.ToString().Should().Be(expected);
67+
builder.ToString().ShouldBe(expected);
6868
}
6969

7070
[Theory]
@@ -78,7 +78,7 @@ public void ShouldAppendFormatWithFourArguments(string format, object arg1, obje
7878

7979
builder.AppendFormat(format, arg1, arg2, arg3, arg4);
8080

81-
builder.ToString().Should().Be(expected);
81+
builder.ToString().ShouldBe(expected);
8282
}
8383

8484
[Theory]
@@ -92,6 +92,6 @@ public void ShouldAppendFormatWithFiveArguments(string format, object arg1, obje
9292

9393
builder.AppendFormat(format, arg1, arg2, arg3, arg4, arg5);
9494

95-
builder.ToString().Should().Be(expected);
95+
builder.ToString().ShouldBe(expected);
9696
}
9797
}

tests/LinkDotNet.StringBuilder.UnitTests/ValueStringBuilder.AppendJoin.Tests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public void ShouldAppendWithStringSeparator(string separator, IEnumerable<string
2929

3030
stringBuilder.AppendJoin(separator, values);
3131

32-
stringBuilder.ToString().Should().Be(expected);
32+
stringBuilder.ToString().ShouldBe(expected);
3333
}
3434

3535
[Theory]
@@ -40,7 +40,7 @@ public void ShouldAppendWithCharSeparator(char separator, IEnumerable<string?> v
4040

4141
stringBuilder.AppendJoin(separator, values);
4242

43-
stringBuilder.ToString().Should().Be(expected);
43+
stringBuilder.ToString().ShouldBe(expected);
4444
}
4545

4646
[Fact]
@@ -50,7 +50,7 @@ public void ShouldAddDataWithStringSeparator()
5050

5151
stringBuilder.AppendJoin(",", new object[] { 1, 1.05f });
5252

53-
stringBuilder.ToString().Should().Be("1,1.05");
53+
stringBuilder.ToString().ShouldBe("1,1.05");
5454
}
5555

5656
[Fact]
@@ -60,6 +60,6 @@ public void ShouldAddDataWithCharSeparator()
6060

6161
stringBuilder.AppendJoin(',', new object[] { 1, 1.05f });
6262

63-
stringBuilder.ToString().Should().Be("1,1.05");
63+
stringBuilder.ToString().ShouldBe("1,1.05");
6464
}
6565
}

tests/LinkDotNet.StringBuilder.UnitTests/ValueStringBuilder.Insert.Tests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public void ShouldInsertString()
1212

1313
valueStringBuilder.Insert(6, "dear ");
1414

15-
valueStringBuilder.ToString().Should().Be("Hello dear World");
15+
valueStringBuilder.ToString().ShouldBe("Hello dear World");
1616
}
1717

1818
[Fact]
@@ -22,7 +22,7 @@ public void ShouldInsertWhenEmpty()
2222

2323
valueStringBuilder.Insert(0, "Hello");
2424

25-
valueStringBuilder.ToString().Should().Be("Hello");
25+
valueStringBuilder.ToString().ShouldBe("Hello");
2626
}
2727

2828
[Fact]
@@ -32,7 +32,7 @@ public void ShouldAppendSpanFormattable()
3232

3333
builder.Insert(0, 2.2f);
3434

35-
builder.ToString().Should().Be("2.2");
35+
builder.ToString().ShouldBe("2.2");
3636
}
3737

3838
[Fact]
@@ -114,7 +114,7 @@ public void ShouldInsertGuid()
114114

115115
builder.Insert(0, Guid.Empty);
116116

117-
builder.ToString().Should().Be("00000000-0000-0000-0000-000000000000");
117+
builder.ToString().ShouldBe("00000000-0000-0000-0000-000000000000");
118118
}
119119

120120
[Fact]
@@ -142,6 +142,6 @@ public void ShouldInsertBool()
142142

143143
builder.Insert(0, true);
144144

145-
builder.ToString().Should().Be("True");
145+
builder.ToString().ShouldBe("True");
146146
}
147147
}

0 commit comments

Comments
 (0)