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
{{ message }}
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.
Message has no abstractions (either interface or abstract base class), but it has 'internal' setter and uses the sealed (why the heck is this?!) SystemPropertiesCollection class.
This completely avoids these classes being mocked and used in unit or behavior testing (while this would easily be achievable with proper bases)!
example:
All message handler testing is impossible, at least because properties are inaccessible. E.g. depending on message.SystemProperties.LockToken results in an InvalidOperationException:
code with await messageReceiver.DeadLetterAsync(message.SystemProperties.LockToken); or alike under test inevitably crashes because message cannot be faked for that use!
Similar cases for several properties of Message appear all the way through tests of message consuming handlers.
solution:
Provide abstractions, make these accessible and base your implementation on those!
The text was updated successfully, but these errors were encountered:
issue:
Message has no abstractions (either interface or abstract base class), but it has 'internal' setter and uses the sealed (why the heck is this?!) SystemPropertiesCollection class.
This completely avoids these classes being mocked and used in unit or behavior testing (while this would easily be achievable with proper bases)!
example:
All message handler testing is impossible, at least because properties are inaccessible. E.g. depending on message.SystemProperties.LockToken results in an InvalidOperationException:
code with
await messageReceiver.DeadLetterAsync(message.SystemProperties.LockToken);
or alike under test inevitably crashes becausemessage
cannot be faked for that use!Similar cases for several properties of Message appear all the way through tests of message consuming handlers.
solution:
Provide abstractions, make these accessible and base your implementation on those!
The text was updated successfully, but these errors were encountered: