The type initializer for 'Umbraco.Extensions.FriendlyPublishedContentExtensions' threw an exception.
Hi
I am trying to build some test for my Umbraco site.
I created a document type with 5 new properties. All is running as i would expect it to run.
I now add the below code for testing
var pp = new Mock<IPublishedProperty>();
var pub = new Mock<IPublishedContent>();
pub.Setup(x => x.Name).Returns("Test");
pub.Setup(x => x.Id).Returns(1234);
pp.Setup(x => x.Alias).Returns("CustomerName");
pp.Setup(x => x.Alias).Returns("Age");
pp.Setup(x => x.GetValue(It.IsAny<string>(), It.IsAny<string>())).Returns("My Customer");
pub.Setup(x => x.GetProperty("customerName")).Returns(pp.Object);
pub.Setup(x => x.GetProperty("age")).Returns(pp.Object);
var cust = new Customer(pub.Object, _publishedFallbackValue.Object);
myService.CallMethod(cust);
When it goes into the CallMethod in myService (which expects an IPublishedContent which is then casted), it throws the error
System.TypeInitializationException: 'The type initializer for 'Umbraco.Extensions.FriendlyPublishedContentExtensions' threw an exception.'
ArgumentNullException: Value cannot be null. ArgParamNameName
Ive tried various changes and have seen some threads here but non work. Any pointers on what im missing?
The type initializer for 'Umbraco.Extensions.FriendlyPublishedContentExtensions' threw an exception.
Hi
I am trying to build some test for my Umbraco site.
I created a document type with 5 new properties. All is running as i would expect it to run.
I now add the below code for testing
myService.CallMethod(cust);
When it goes into the CallMethod in myService (which expects an IPublishedContent which is then casted), it throws the error
System.TypeInitializationException: 'The type initializer for 'Umbraco.Extensions.FriendlyPublishedContentExtensions' threw an exception.' ArgumentNullException: Value cannot be null. ArgParamNameName
Ive tried various changes and have seen some threads here but non work. Any pointers on what im missing?
is working on a reply...