Skip to content

Commit 727a1a2

Browse files
committed
Upgrade to .NET 10.0 and refactor solution
Upgraded the entire SampleMvcCRUD solution from .NET 9.0 to .NET 10.0 using a Big Bang strategy, updating all 7 projects simultaneously. Modified project files to reflect the new framework version and updated package references to .NET 10 compatible versions. Removed the `Mwh.Sample.HttpClientFactory` project and its files, indicating a refactor or consolidation of functionality. Refactored test methods in `StringExtensionsTests.cs` and `DepartmentDtoTests.cs` to manually check for exceptions, improving test clarity. Updated `README.md` with new framework details, project goals, and instructions. Created `UPGRADE-SUMMARY.md` to document the upgrade process. Enhanced the user interface in `Index.cshtml` with new table actions and a DataTable script. Updated `Program.cs` for Swagger configuration changes and added HttpClient factory registration. Deleted unused binary files for cleanup. Updated the solution file to remove references to the deleted project and reflect the new Visual Studio version. Created documentation files to track the upgrade process and ensure a detailed audit trail. All 192 unit tests passed, confirming compatibility with .NET 10.0 and no breaking changes.
1 parent 5e476ac commit 727a1a2

File tree

25 files changed

+733
-590
lines changed

25 files changed

+733
-590
lines changed

.github/upgrades/UPGRADE-SUMMARY.md

Lines changed: 493 additions & 0 deletions
Large diffs are not rendered by default.

.github/upgrades/execution-log.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,22 @@ Status: Complete
4242

4343
Success - All unit tests pass successfully after .NET 10 upgrade. No test failures encountered, confirming compatibility.
4444

45+
46+
## [2025-11-16 13:00] TASK-003: Final atomic commit
47+
48+
Status: Complete
49+
50+
- **Verified**: Changes committed successfully to Git
51+
- **Commits**: 5e476ac: "feat: upgrade solution to .NET 10.0"
52+
- **Files Modified**:
53+
- All 7 project files (.csproj)
54+
- All package references updated
55+
- **Files Created**:
56+
- .github/upgrades/assessment.md
57+
- .github/upgrades/plan.md
58+
- .github/upgrades/tasks.md
59+
- .github/upgrades/execution-log.md
60+
- .github/upgrades/commit-message.txt
61+
62+
Success - Atomic commit completed. All .NET 10 upgrade changes committed to branch upgrade-to-NET10.
63+

.github/upgrades/tasks.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
This scenario upgrades the entire SampleMvcCRUD solution (7 projects) from .NET 9.0 to .NET 10.0 using the Big Bang strategy. All framework and package updates are performed atomically, followed by unified testing and a single commit.
66

7-
**Progress**: 2/3 tasks complete (67%) ![67%](https://progress-bar.xyz/67)
7+
**Progress**: 3/3 tasks complete (100%) ![100%](https://progress-bar.xyz/100)
88

99
## Tasks
1010

@@ -25,8 +25,8 @@ This scenario upgrades the entire SampleMvcCRUD solution (7 projects) from .NET
2525
- [] (3) Re-run tests after fixes
2626
- [] (4) All tests passed with 0 failures (**Verify**)
2727

28-
### [] TASK-003: Final atomic commit
28+
### [] TASK-003: Final atomic commit *(Completed: 2025-11-16 13:00)*
2929
**References**: Plan §10.2, Plan §10.3
3030

31-
- [] (1) Commit all changes with message: "feat: upgrade solution to .NET 10.0"
32-
- [] (2) Changes committed successfully (**Verify**)
31+
- [] (1) Commit all changes with message: "feat: upgrade solution to .NET 10.0"
32+
- [] (2) Changes committed successfully (**Verify**)

Mwh.Sample.Console/Mwh.Sample.Console.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</None>
2323
</ItemGroup>
2424
<ItemGroup>
25-
<PackageReference Include="Bogus" Version="35.6.3" />
25+
<PackageReference Include="Bogus" Version="35.6.5" />
2626
</ItemGroup>
2727
<ItemGroup>
2828
<ProjectReference Include="..\Mwh.Sample.Domain\Mwh.Sample.Domain.csproj" />

Mwh.Sample.Domain.Tests/Extensions/StringExtensionsTests.cs

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using Microsoft.VisualStudio.TestTools.UnitTesting;
12

23
namespace Mwh.Sample.Domain.Tests.Extensions;
34

@@ -172,11 +173,19 @@ public void IndexOfNthTestSourceNull()
172173
/// Defines the test method IndexOfNthTestValueNegativeNth. Throws exception
173174
/// </summary>
174175
[TestMethod()]
175-
[ExpectedException(typeof(ArgumentException))]
176176
public void IndexOfNthTestValueNegativeNth()
177177
{
178178
string myTest = "333333";
179-
int test = myTest.IndexOfNth("3", -1);
179+
bool exceptionThrown = false;
180+
try
181+
{
182+
myTest.IndexOfNth("3", -1);
183+
}
184+
catch (ArgumentException)
185+
{
186+
exceptionThrown = true;
187+
}
188+
Assert.IsTrue(exceptionThrown, "Expected ArgumentException was not thrown");
180189
}
181190

182191
/// <summary>
@@ -198,17 +207,6 @@ public void LeftTest_ShortString()
198207
string myTest = "01";
199208
Assert.AreEqual("01", myTest.Left(5));
200209
}
201-
/// <summary>
202-
/// Defines the test method LeftTest.
203-
/// </summary>
204-
[ExpectedException(typeof(ArgumentException))]
205-
[TestMethod()]
206-
public void LeftTest_NegativeLength()
207-
{
208-
string myTest = "01";
209-
_ = myTest.Left(-1);
210-
}
211-
212210
/// <summary>
213211
/// Defines the test method LeftTest.
214212
/// </summary>
@@ -239,6 +237,25 @@ public void LeftTestNullString()
239237
Assert.AreEqual(string.Empty, myTest.Left(2));
240238
}
241239

240+
/// <summary>
241+
/// Defines the test method LeftTest.
242+
/// </summary>
243+
[TestMethod()]
244+
public void LeftTest_NegativeLength()
245+
{
246+
string myTest = "01";
247+
bool exceptionThrown = false;
248+
try
249+
{
250+
_ = myTest.Left(-1);
251+
}
252+
catch (ArgumentException)
253+
{
254+
exceptionThrown = true;
255+
}
256+
Assert.IsTrue(exceptionThrown, "Expected ArgumentException was not thrown");
257+
}
258+
242259
/// <summary>
243260
/// Defines the test method RightTest.
244261
/// </summary>

Mwh.Sample.Domain.Tests/Models/DepartmentDtoTests.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,16 @@ public void DepartmentDto_SetInvalidName_ThrowsArgumentException()
4444
DepartmentDto department = new DepartmentDto(EmployeeDepartmentEnum.IT);
4545

4646
// Act and Assert
47-
Assert.ThrowsException<ArgumentException>(() => department.Name = " ");
47+
bool exceptionThrown = false;
48+
try
49+
{
50+
department.Name = " ";
51+
}
52+
catch (ArgumentException)
53+
{
54+
exceptionThrown = true;
55+
}
56+
Assert.IsTrue(exceptionThrown, "Expected ArgumentException was not thrown");
4857
}
4958

5059
[TestMethod]

Mwh.Sample.Domain.Tests/Models/EmployeeDtoTests.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
namespace Mwh.Sample.Domain.Tests.Models;
32

43
/// <summary>
@@ -183,7 +182,16 @@ public void EmployeeDto_InvalidData_ThrowsArgumentException()
183182
EmployeeDepartmentEnum department = EmployeeDepartmentEnum.IT;
184183

185184
// Act and Assert
186-
Assert.ThrowsException<EmployeeDtoValidationException>(() => new EmployeeDto(id, name, age, state, country, department));
185+
bool exceptionThrown = false;
186+
try
187+
{
188+
_ = new EmployeeDto(id, name, age, state, country, department);
189+
}
190+
catch (EmployeeDtoValidationException)
191+
{
192+
exceptionThrown = true;
193+
}
194+
Assert.IsTrue(exceptionThrown, "Expected EmployeeDtoValidationException was not thrown");
187195
}
188196

189197

Mwh.Sample.Domain.Tests/Mwh.Sample.Domain.Tests.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
</None>
1919
</ItemGroup>
2020
<ItemGroup>
21-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
22-
<PackageReference Include="MSTest.TestAdapter" Version="3.10.4" />
23-
<PackageReference Include="MSTest.TestFramework" Version="3.10.4" />
21+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
22+
<PackageReference Include="MSTest.TestAdapter" Version="4.0.2" />
23+
<PackageReference Include="MSTest.TestFramework" Version="4.0.2" />
2424
<PackageReference Include="coverlet.collector" Version="6.0.4">
2525
<PrivateAssets>all</PrivateAssets>
2626
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

Mwh.Sample.Domain/Interfaces/IRestClientBase.cs

Lines changed: 0 additions & 29 deletions
This file was deleted.

Mwh.Sample.Domain/Mwh.Sample.Domain.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<PropertyGroup>
88
<Deterministic>false</Deterministic>
99
<SourceRevisionId>build$([System.DateTime]::UtcNow.ToString("yyyyMMddHHmmss"))</SourceRevisionId>
10-
<AssemblyVersion>9.$([System.DateTime]::UtcNow.ToString(yyMM)).$([System.DateTime]::UtcNow.ToString(ddHH)).$([System.DateTime]::UtcNow.ToString(mmss))</AssemblyVersion>
10+
<AssemblyVersion>10.$([System.DateTime]::UtcNow.ToString(yyMM)).$([System.DateTime]::UtcNow.ToString(ddHH)).$([System.DateTime]::UtcNow.ToString(mmss))</AssemblyVersion>
1111
<ApplicationIcon>favicon.ico</ApplicationIcon>
1212
<PackageIcon>favicon.ico</PackageIcon>
1313
</PropertyGroup>

0 commit comments

Comments
 (0)