Skip to content

Commit

Permalink
improve Primitive.Null environment #29 #30
Browse files Browse the repository at this point in the history
improve Primitive.Null environment #29 #30
  • Loading branch information
alec1o committed Jul 8, 2024
1 parent b1041cf commit 0799cb4
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions test/primitive/Primitive.Null.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,24 +94,27 @@ public void Null()

public static class NullConfig
{
public static string EmptyString = "";
public static string NullString = "";
#pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type.
public static readonly string EmptyString = "";
public static readonly string NullString = null;

public static byte[] EmptyArray = [];
public static byte[] NullArray = null;
public static readonly byte[] EmptyArray = [];

public static List<byte> EmptyList = [];
public static List<byte> NullList = null;
public static readonly byte[] NullArray = null;

public static NonEmptyClass TheEmptyClass = new();
public static NonEmptyClass TheNullClass = null;
public static readonly List<byte> EmptyList = [];
public static readonly List<byte> NullList = null;

public static EmptyStruct TheEmptyStruct = new();
public static NonEmptyStruct TheNullStruct = default;
public static readonly NonEmptyClass TheEmptyClass = new();
public static readonly NonEmptyClass TheNullClass = null;

public static EmptyEnum TheEmptyEnum = new();
public static NonEmptyEnum TheNullEnum = default;
public static readonly EmptyStruct TheEmptyStruct = new();
public static readonly NonEmptyStruct TheNullStruct = default;

public static readonly EmptyEnum TheEmptyEnum = new();
public static readonly NonEmptyEnum TheNullEnum = default;

// ReSharper disable once ClassNeverInstantiated.Global
public class EmptyClass
{
}
Expand All @@ -132,11 +135,12 @@ public struct NonEmptyStruct

public enum NonEmptyEnum
{
Byter
Unique
}

public enum EmptyEnum
{
}
#pragma warning restore CS8625 // Cannot convert null literal to non-nullable reference type.
}
}

0 comments on commit 0799cb4

Please sign in to comment.