You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The test WhenStatementWithSingleArgument_ParamNameIsEmptyString exposes a weakness in the current implementation. It's by no means a terrible bug but it's there and it should probably go away.
The problem here is that all we have access too is simple reflection on the class generated by the compiler to handle the lambda closure. This gives us no information as to what the method in the lambda actually does.
Options
Find a way to get the IL or some other representation of the method that can be parsed.
Use the much slower approach of passing an Expression<Func<T>> that requires compiling the method every time even when the requirement is met.
Make a separate package for RequireThat.Lambda using platform specific implementations. Using either the hack version or Expression<Func<T>> on the platforms that do not support GetMethodBody()
However, as long as the library is used as intended this should never show it's face and maybe it should just be documented as a known flaw and we move on.
The text was updated successfully, but these errors were encountered:
The test
WhenStatementWithSingleArgument_ParamNameIsEmptyString
exposes a weakness in the current implementation. It's by no means a terrible bug but it's there and it should probably go away.The problem here is that all we have access too is simple reflection on the class generated by the compiler to handle the lambda closure. This gives us no information as to what the method in the lambda actually does.
Options
Expression<Func<T>>
that requires compiling the method every time even when the requirement is met.RequireThat.Lambda
using platform specific implementations. Using either the hack version orExpression<Func<T>>
on the platforms that do not supportGetMethodBody()
However, as long as the library is used as intended this should never show it's face and maybe it should just be documented as a known flaw and we move on.
The text was updated successfully, but these errors were encountered: