-
-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use dotnet sonar scanner (part 2) (#1125)
* ddd * ---ddd * f * revert * /d:sonar.branch.name=$(Build.SourceBranchName) * FIX * coverlet * coverlet - 1 line * dotnet-coverage * --configuration Debug --no-build --framework net8.0 * script * /d: * collect? * "wiremock-coverage.xml" * see * tests
- Loading branch information
Showing
2 changed files
with
57 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System; | ||
using FluentAssertions; | ||
using WireMock.Extensions; | ||
using Xunit; | ||
|
||
namespace WireMock.Net.Tests.Extensions; | ||
|
||
public class EnumExtensionsTests | ||
{ | ||
private enum TestEnum | ||
{ | ||
Value1 | ||
} | ||
|
||
[Fact] | ||
public void EnumExtensions_GetFullyQualifiedEnumValue_ShouldReturnCorrectValue() | ||
{ | ||
// Arrange | ||
var enumValue = TestEnum.Value1; | ||
|
||
// Act | ||
var result = enumValue.GetFullyQualifiedEnumValue(); | ||
|
||
// Assert | ||
result.Should().Be("WireMock.Net.Tests.Extensions.TestEnum.Value1"); | ||
} | ||
|
||
[Fact] | ||
public void EnumExtensions_GetFullyQualifiedEnumValue_ShouldThrowArgumentException_WhenTypeIsNotEnum() | ||
{ | ||
// Arrange | ||
int nonEnumValue = 42; | ||
|
||
// Act | ||
Action act = () => nonEnumValue.GetFullyQualifiedEnumValue(); | ||
|
||
// Assert | ||
act.Should().Throw<ArgumentException>().WithMessage("T must be an enum"); | ||
} | ||
} |