using System.Diagnostics;
public static void Main()
StringGatewayTests.IsNullOrWhiteSpace_NullValue_ReturnsTrue();
StringGatewayTests.IsNullOrWhiteSpace_EmptyValue_ReturnsTrue();
StringGatewayTests.IsNullOrWhiteSpace_AllWhiteSpaceValue_ReturnsTrue();
StringGatewayTests.IsInterned_NullValue_ReturnsFalse();
StringGatewayTests.IsInterned_StringLiteralValue_ReturnsTrue();
StringGatewayTests.IsInternedV2_NullValue_ReturnsTrue();
public static class StringGateway
public static bool IsNullOrWhiteSpace(this string str) => string.IsNullOrWhiteSpace(str);
public static bool IsInterned(this string str) => str is not null && string.IsInterned(str) is string;
public static string? IsInternedV2(this string str) => string.IsInterned(str);
public class StringGatewayTests
public static void Assert(bool value)
public static void IsNullOrWhiteSpace_NullValue_ReturnsTrue()
bool Result = Value.IsNullOrWhiteSpace();
public static void IsNullOrWhiteSpace_EmptyValue_ReturnsTrue()
string Value = string.Empty;
bool Result = Value.IsNullOrWhiteSpace();
public static void IsNullOrWhiteSpace_AllWhiteSpaceValue_ReturnsTrue()
string Value = " \r\n \t";
bool Result = Value.IsNullOrWhiteSpace();
public static void IsInterned_NullValue_ReturnsFalse()
bool Result = Value.IsInterned();
public static void IsInterned_StringLiteralValue_ReturnsTrue()
string Value = "This is a test.";
bool Result = Value.IsInterned();
public static void IsInternedV2_NullValue_ReturnsTrue()
string Value = "a constant string";
string Result = Value.IsInternedV2();
System.Diagnostics.Debug.Assert(Result != null);