Commit 0ed681f 1 parent bc8352d commit 0ed681f Copy full SHA for 0ed681f
File tree 1 file changed +40
-0
lines changed
test/WireMock.Net.Tests/Extensions
1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ using System ;
2
+ using FluentAssertions ;
3
+ using WireMock . Extensions ;
4
+ using Xunit ;
5
+
6
+ namespace WireMock . Net . Tests . Extensions ;
7
+
8
+ public class EnumExtensionsTests
9
+ {
10
+ private enum TestEnum
11
+ {
12
+ Value1
13
+ }
14
+
15
+ [ Fact ]
16
+ public void EnumExtensions_GetFullyQualifiedEnumValue_ShouldReturnCorrectValue ( )
17
+ {
18
+ // Arrange
19
+ var enumValue = TestEnum . Value1 ;
20
+
21
+ // Act
22
+ var result = enumValue . GetFullyQualifiedEnumValue ( ) ;
23
+
24
+ // Assert
25
+ result . Should ( ) . Be ( "WireMock.Net.Tests.Extensions.TestEnum.Value1" ) ;
26
+ }
27
+
28
+ [ Fact ]
29
+ public void EnumExtensions_GetFullyQualifiedEnumValue_ShouldThrowArgumentException_WhenTypeIsNotEnum ( )
30
+ {
31
+ // Arrange
32
+ int nonEnumValue = 42 ;
33
+
34
+ // Act
35
+ Action act = ( ) => nonEnumValue . GetFullyQualifiedEnumValue ( ) ;
36
+
37
+ // Assert
38
+ act . Should ( ) . Throw < ArgumentException > ( ) . WithMessage ( "T must be an enum" ) ;
39
+ }
40
+ }
You can’t perform that action at this time.
0 commit comments