NUnitString
A class to allow postponing the actual formatting of interpolated strings.
using System;
using System.
Runtime.
CompilerServices;
namespace NUnit.
Framework
{
[
NullableContext(
2)]
[
Nullable(
0)]
public readonly struct NUnitString
{
private readonly string _message;
public NUnitString(
string message)
{
_message =
message;
}
public static implicit operator NUnitString(
FormattableString formattableMessage)
{
throw new NotImplementedException();
}
public static implicit operator NUnitString(
string message)
{
return new NUnitString(
message);
}
[
NullableContext(
1)]
public override string ToString()
{
return _message ??
string.
Empty;
}
}
}