PnP.Core - How to set the Values property In IListItem for test mocking? #1530
Unanswered
JustinCLyon
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When attempting to implement unit tests for my application, I've run into an issue in setting the
values
property for an IListItem.I was successful in mocking the return values when indexing (example:
listItem[FileLeafRef]
), however the Values seems to use aTransientDictionary
instead of aDictionary<string, object>
. SinceTransientDictionary
has no public constructor, there's no way for me to construct the object, and I can't just return aDictionary<string, object>
either.Are there any solutions for this?
Update: I used reflection to make a temporary solution for this, however I was wondering if there was a more elegant way to mock the list item field values?
Beta Was this translation helpful? Give feedback.
All reactions