TUnit
TUnit copied to clipboard
Move assertion extensions to properties with C#13 type extensions
Example: DateTimeExtensions.cs
For DateTime =>
public static extension DateTime
{
private static readonly string? DateFormat = "yyyy/MM/dd";
private static readonly string? LongTimeFormatWithMilliseconds = "hh:mm:ss.ffff tt";
private static readonly string? LongDateTimeFormatWithMilliseconds = $"{DateFormat} {LongTimeFormatWithMilliseconds}";
public string ToLongStringWithMilliseconds => this.ToString(LongDateTimeFormatWithMilliseconds);
}
Is this the pattern you are looking for @thomhurst ?
@SaileshBK Yeah that's along the lines of what I wanted to trial, but I heard it got delayed and isn't going to make it into C#13
I will keep an eye on the feature itself, I am really excited about the C# 13 Type extensions as well. How about I work on this and slowly start migrating all the assertion extensions and make PR for it @thomhurst :)?