Answers for "mock ioptions"

0

mock ioptions

ProducerConfigSettings appSettings = new ProducerConfigSettings()
 {
     Key1 = "testkey1",
     Key2 = "Testkey2"
 };
 var mockIOption = new Mock<IOptions<ProducerConfigSettings>>();
 // We need to set the Value of IOptions to be the SampleOptions Class
 mockIOption.Setup(ap => ap.Value).Returns(appSettings)
Posted by: Guest on January-20-2022

Browse Popular Code Answers by Language