var prop = new Mock<IPublishedProperty>();
prop.Setup(p => p.Value).Returns(value);
Mock.Get(content).Setup(c => c.GetProperty(alias, false)).Returns(prop.Object);
The property object does not set properly. The value gets set up but the PropertyTypeAlias comes null, DataValue is null and HasValue is false as a result.
Issue setting mocked property value of IPublishedContent mocked object during unit testing
I'm trying out
UmbracoSupport
: https://github.com/lars-erik/umbraco-unit-testing-samples/blob/master/Umb.Testing.Tests/SampleUmbracoTests/StubbingAuthorAnd_Date.csHowever when I'm executing:
The property object does not set properly. The value gets set up but the
PropertyTypeAlias
comes null,DataValue
is null andHasValue
is false as a result.What could I have missed?
is working on a reply...