I am in the process of adding unit tests to an Umbraco 13.4 site, retrospectively after completion. We need to test IUmbracoBuilder extension methods. So I am having problems trying to create an instance of UmbracoBuilder because of the constructor's parameter, one of which is a TypeLoader.
Fortunately, in the source is a project called Umbraco.Tests.UnitTests that has a ComponentTests with a test called Boot1A. It creates a test harness for UmbracoBuilder using this (line 119 of tag Branch_release-13.4.0 ):
var composition = new UmbracoBuilder(register, Mock.Of<IConfiguration>(), TestHelper.GetMockedTypeLoader());
I want to use this test project, and I remember that the advice was to add references to the source code, but why do I have to do that now? Also which DLLs do I need to reference to get this TestHelper?
Testing extension methods for UmbracoBuilder
I am in the process of adding unit tests to an Umbraco 13.4 site, retrospectively after completion. We need to test IUmbracoBuilder extension methods. So I am having problems trying to create an instance of UmbracoBuilder because of the constructor's parameter, one of which is a TypeLoader.
Fortunately, in the source is a project called Umbraco.Tests.UnitTests that has a ComponentTests with a test called Boot1A. It creates a test harness for UmbracoBuilder using this (line 119 of tag Branch_release-13.4.0 ):
I want to use this test project, and I remember that the advice was to add references to the source code, but why do I have to do that now? Also which DLLs do I need to reference to get this TestHelper?
is working on a reply...