Closed bacongobbler closed 1 year ago
The code expects that all lists on the response are initialized, at least with an empty result, so if you add
dnsResponseMock.Setup(x => x.Additionals).Returns(new List<DnsResourceRecord>());
That should do.
Oh thank you! That did it.
I'm working on a service that will resolve Consul SRV records, and I want to mock out the
ILookupClient
's call toResolveServiceAsync
. Better yet would be providing my ownNameServer
so I could simulate a real-world SRV record lookup.Do you have an example for mocking out
ResolveServiceAsync
? This is as close as I've gotten:But I get the following result:
Uncommenting the
ResolveServiceAsync
setup code returns the following error: