How do you mock interfaces in unit testing?
- Use mocking frameworks like Moq or NSubstitute.
- Provides fake implementations to test dependent classes.
var mockLogger = new Mock<ILogger>();
mockLogger.Setup(x => x.Log(It.IsAny<string>()));
var mockLogger = new Mock<ILogger>();
mockLogger.Setup(x => x.Log(It.IsAny<string>()));