Hi!
Just as an FYI: Before I switched to TUnit I had already created an issue a while back at fluentassertions/fluentassertions#2632.
The idea is pretty much to verify, that a given string is in such a format, that an instance of type TTarget can be created out of it.
So yes, TTarget is expected to have a ready implementation of the Parsing Methods.
In my previous issue I hadn't payed attention, but there are also interfaces dedicated to ReadOnlySpan<char> and ReadOnlySpan<byte>, so I'd include those in my idea here.
Since there are always two methods Parse and TryParse there was a discussion on which one was to be used, with the former being settled on.
In my mind TUnit would then end up having new APIs like so:
Assert.That(...)
.IsParsableInto<TTarget>()
.WithFormatProvider(IFormatProvider? provider);
Assert.That(...)
.IsNotParsableInto<TTarget>()
.WithFormatProvider(IFormatProvider? provider);
Hi!
Just as an FYI: Before I switched to TUnit I had already created an issue a while back at fluentassertions/fluentassertions#2632.
The idea is pretty much to verify, that a given string is in such a format, that an instance of type
TTargetcan be created out of it.So yes,
TTargetis expected to have a ready implementation of the Parsing Methods.In my previous issue I hadn't payed attention, but there are also interfaces dedicated to
ReadOnlySpan<char>andReadOnlySpan<byte>, so I'd include those in my idea here.Since there are always two methods
ParseandTryParsethere was a discussion on which one was to be used, with the former being settled on.In my mind TUnit would then end up having new APIs like so: