aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAmbulantRex <21176662+AmbulantRex@users.noreply.github.com>2023-04-16 18:47:57 -0600
committerAmbulantRex <21176662+AmbulantRex@users.noreply.github.com>2023-04-16 18:47:57 -0600
commitc7174255498e28272fbe6d4d6867a774a3327eff (patch)
tree4f0205cbaa118d79d944b028427b25da12e2f6c9 /tests
parent92f50054b28c85afbee0dfa99016c4b71548de6f (diff)
Remove unnecessary type extension and handle feedback.
Diffstat (limited to 'tests')
-rw-r--r--tests/Jellyfin.Extensions.Tests/TypeExtensionsTests.cs68
1 files changed, 0 insertions, 68 deletions
diff --git a/tests/Jellyfin.Extensions.Tests/TypeExtensionsTests.cs b/tests/Jellyfin.Extensions.Tests/TypeExtensionsTests.cs
deleted file mode 100644
index 747913fa1..000000000
--- a/tests/Jellyfin.Extensions.Tests/TypeExtensionsTests.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-using System;
-using Xunit;
-
-namespace Jellyfin.Extensions.Tests
-{
- public class TypeExtensionsTests
- {
- [Theory]
- [InlineData(typeof(byte), byte.MaxValue, false)]
- [InlineData(typeof(short), short.MinValue, false)]
- [InlineData(typeof(ushort), ushort.MaxValue, false)]
- [InlineData(typeof(int), int.MinValue, false)]
- [InlineData(typeof(uint), uint.MaxValue, false)]
- [InlineData(typeof(long), long.MinValue, false)]
- [InlineData(typeof(ulong), ulong.MaxValue, false)]
- [InlineData(typeof(decimal), -1.0, false)]
- [InlineData(typeof(bool), true, false)]
- [InlineData(typeof(char), 'a', false)]
- [InlineData(typeof(string), "", false)]
- [InlineData(typeof(object), 1, false)]
- [InlineData(typeof(byte), 0, true)]
- [InlineData(typeof(short), 0, true)]
- [InlineData(typeof(ushort), 0, true)]
- [InlineData(typeof(int), 0, true)]
- [InlineData(typeof(uint), 0, true)]
- [InlineData(typeof(long), 0, true)]
- [InlineData(typeof(ulong), 0, true)]
- [InlineData(typeof(decimal), 0, true)]
- [InlineData(typeof(bool), false, true)]
- [InlineData(typeof(char), '\x0000', true)]
- [InlineData(typeof(string), null, true)]
- [InlineData(typeof(object), null, true)]
- [InlineData(typeof(PhonyClass), null, true)]
- [InlineData(typeof(DateTime), null, true)] // Special case handled within the test.
- [InlineData(typeof(DateTime), null, false)] // Special case handled within the test.
- [InlineData(typeof(byte?), null, true)]
- [InlineData(typeof(short?), null, true)]
- [InlineData(typeof(ushort?), null, true)]
- [InlineData(typeof(int?), null, true)]
- [InlineData(typeof(uint?), null, true)]
- [InlineData(typeof(long?), null, true)]
- [InlineData(typeof(ulong?), null, true)]
- [InlineData(typeof(decimal?), null, true)]
- [InlineData(typeof(bool?), null, true)]
- [InlineData(typeof(char?), null, true)]
- public void IsNullOrDefault_Matches_Expected(Type type, object? value, bool expectedResult)
- {
- if (type == typeof(DateTime))
- {
- if (expectedResult)
- {
- value = default(DateTime);
- }
- else
- {
- value = DateTime.Now;
- }
- }
-
- Assert.Equal(expectedResult, type.IsNullOrDefault(value));
- Assert.Equal(expectedResult, value.IsNullOrDefault());
- }
-
- private class PhonyClass
- {
- }
- }
-}