@@ -86,11 +86,6 @@ def test_ulong_enum():
86
86
assert Test .ULongEnum .Two == Test .ULongEnum (2 )
87
87
88
88
89
- def test_simple_enum_to_int ():
90
- from System import DayOfWeek
91
- assert int (DayOfWeek .Sunday ) == 0
92
-
93
-
94
89
def test_long_enum_to_int ():
95
90
assert int (Test .LongEnum .Max ) == 9223372036854775807
96
91
assert int (Test .LongEnum .Min ) == - 9223372036854775808
@@ -178,6 +173,54 @@ def test_enum_conversion():
178
173
Test .FieldTest ().EnumField = 1
179
174
180
175
176
+ def test_byte_enum_to_int ():
177
+ """Test byte enum to int"""
178
+ assert bool (Test .ByteEnum .Zero ) == 0
179
+ assert bool (Test .ByteEnum .One ) == 1
180
+
181
+
182
+ def test_sbyte_enum_to_int ():
183
+ """Test sbyte enum to int"""
184
+ assert bool (Test .SByteEnum .Zero ) == 0
185
+ assert bool (Test .SByteEnum .One ) == 1
186
+
187
+
188
+ def test_short_enum_to_int ():
189
+ """Test short enum to int"""
190
+ assert bool (Test .ShortEnum .Zero ) == 0
191
+ assert bool (Test .ShortEnum .One ) == 1
192
+
193
+
194
+ def test_ushort_enum_to_int ():
195
+ """Test ushort enum to int"""
196
+ assert bool (Test .UShortEnum .Zero ) == 0
197
+ assert bool (Test .UShortEnum .One ) == 1
198
+
199
+
200
+ def test_int_enum_to_int ():
201
+ """Test int enum to int"""
202
+ assert bool (Test .IntEnum .Zero ) == 0
203
+ assert bool (Test .IntEnum .One ) == 1
204
+
205
+
206
+ def test_uint_enum_to_int ():
207
+ """Test uint enum to int"""
208
+ assert bool (Test .UIntEnum .Zero ) == 0
209
+ assert bool (Test .UIntEnum .One ) == 1
210
+
211
+
212
+ def test_long_enum_to_int ():
213
+ """Test long enum to int"""
214
+ assert bool (Test .LongEnum .Zero ) == 0
215
+ assert bool (Test .LongEnum .One ) == 1
216
+
217
+
218
+ def test_ulong_enum_to_int ():
219
+ """Test ulong enum to int"""
220
+ assert bool (Test .ULongEnum .Zero ) == 0
221
+ assert bool (Test .ULongEnum .One ) == 1
222
+
223
+
181
224
def test_byte_enum_to_bool ():
182
225
"""Test byte enum to bool"""
183
226
assert bool (Test .ByteEnum .Zero ) == False
0 commit comments