is there any way I can Mock read-only property
public string DefaultHostName { get; }
https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteData.cs
You could use Nsubstitute Returns method :
var myObjectMock = Substitute.For<MyClass>(); myObjectMock.DefaultHostName.Returns("DefaulHostName");
You could use Nsubstitute Returns method :