chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
0 votes
Hi,

How can we fake web.AllProperties. I can add a property using web.Properties however in my code, i am using web.AllProperties, if i try to add a mock property using fakeSite.OpenWeb().AllProperties.Add("Max_Personal_Links","10"); it throws object ref exception as AllProperties returns null whereas Isolate.WhenCalled(() => fakeSite.OpenWeb().Properties["Max_Personal_Links"]).WillReturn("10"); works fine.

Please help:(
asked by sandhya.bakshi (1.1k points)

1 Answer

0 votes
Hi,

Is faking the property through
WhenCalled(() => fakeSite.OpenWeb().Properties["Max_Personal_Links"]) 
not sufficient? Can you post an example where you would not be able to use that?

Doron
Typemock Support
answered by doron (17.2k points)
...