public static void Main()
StringGatewayTests.IsNullOrWhiteSpace_NullValue_ReturnsTrue();
StringGatewayTests.IsNullOrWhiteSpace_EmptyValue_ReturnsTrue();
StringGatewayTests.IsNullOrWhiteSpace_AllWhitespaceValue_ReturnsTrue();
StringGatewayTests.IsInterned_NullValue_ReturnsFalse();
public static class StringGateway
public static bool IsNullOrWhiteSpace(this string str) => string.IsNullOrWhiteSpace(str);
public static bool IsInterned(this string str)
if (str is not null && string.IsInterned(str) is string interned)
public class StringGatewayTests
private static string Value;
public static void IsNullOrWhiteSpace_NullValue_ReturnsTrue()
bool Result = Value.IsNullOrWhiteSpace();
System.Diagnostics.Debug.Assert(Result == true);
Console.WriteLine("Test2");
public static void IsNullOrWhiteSpace_EmptyValue_ReturnsTrue()
bool Result = Value.IsNullOrWhiteSpace();
System.Diagnostics.Debug.Assert(Result == true);
Console.WriteLine("Test1");
public static void IsNullOrWhiteSpace_AllWhitespaceValue_ReturnsTrue()
bool Result = Value.IsNullOrWhiteSpace();
System.Diagnostics.Debug.Assert(Result == true);
Console.WriteLine("Test");
public static void IsInterned_NullValue_ReturnsFalse()
bool Result = Value.IsInterned();
System.Diagnostics.Debug.Assert(Result == false);
public static void IsInterned_StringLiteralValue_ReturnsTrue()
Value = "This is a test.";
bool Result = Value.IsInterned();
System.Diagnostics.Debug.Assert(Result == true);