Files
speckle-sharp-sdk/tests/Speckle.Sdk.Tests.Unit/Serialisation/PrimitiveTestFixture.cs
T
Jedd Morgan a143553a09
.NET Build and Publish / build (push) Has been cancelled
feat(netcore): Add Net10 target to SDK and drop sln (#442)
* .net10 attempt 2

* bump csharpier

* drop sln

* supress stream analyers for test projects

* readme

* fix package locks post merge

* Microsoft.Extensions.DependencyInjection

* Simplify the dependency structure

* don't bump graphql client for netstandard and net8 targets

* Fix test
2026-04-15 17:48:32 +01:00

49 lines
1.6 KiB
C#

namespace Speckle.Sdk.Tests.Unit.Serialisation;
public abstract class PrimitiveTestFixture
{
public static IEnumerable<object[]> Int8TestCases =>
new sbyte[] { 0, sbyte.MaxValue, sbyte.MinValue }.Select(x => new object[] { x });
public static readonly short[] Int16TestCases = [short.MaxValue, short.MinValue];
public static IEnumerable<object[]> Int32TestCases =>
new int[] { int.MinValue, int.MaxValue }.Select(x => new object[] { x });
public static IEnumerable<object[]> Int64TestCases =>
new long[] { long.MinValue, long.MaxValue }.Select(x => new object[] { x });
public static IEnumerable<object[]> UInt64TestCases =>
new ulong[] { ulong.MinValue, ulong.MaxValue }.Select(x => new object[] { x });
public static IEnumerable<object[]> Float64TestCases =>
new[]
{
0,
double.Epsilon,
double.MaxValue,
double.MinValue,
double.PositiveInfinity,
double.NegativeInfinity,
double.NaN,
}.Select(x => new object[] { x });
public static IEnumerable<object[]> Float32TestCases =>
new[]
{
default,
float.Epsilon,
float.MaxValue,
float.MinValue,
float.PositiveInfinity,
float.NegativeInfinity,
float.NaN,
}.Select(x => new object[] { x });
public static Half[] Float16TestCases { get; } =
[default, Half.Epsilon, Half.MaxValue, Half.MinValue, Half.PositiveInfinity, Half.NegativeInfinity, Half.NaN];
public static float[] FloatIntegralTestCases { get; } = [0, 1, int.MaxValue, int.MinValue];
public static IEnumerable<object[]> MyEnums { get; } =
Enum.GetValues<MyEnum>().Cast<object>().Select(x => new[] { x });
}