one of the tests we're trying to write requires a mocked out IPublishedContent with child nodes.
this is what we have:
var repo = new MockRepository(MockBehavior.Default);
var node = repo.Create<IPublishedContent>();
node.Setup(x => x.Id).Returns(1);
node.Setup(x => x.DocumentTypeAlias).Returns("Folder");
unit testing: moqing out IPublishedContent with child nodes
hello out there,
making slow progress with unit testing but had some sucsess today (http://our.umbraco.org/forum/umbraco-7/using-umbraco-7/60476-unit-testing-creating-an-UmbracoContext-throws-an-exception!) but've got a new one:
one of the tests we're trying to write requires a mocked out IPublishedContent with child nodes.
this is what we have:
but for our test to run we need to populate:
more specificallty, for this particluar test the 1st child needs to have a 'DocumentTypeAlias' of 'Image'.
the trick is that 'Children' is a 'IEnumerable
any clues?
cheers,
jake
is working on a reply...