For .NET, you could use something like TypeMock, which uses the profiling API and allows you to hook into calls to nearly anything.
More Related Contents:
- What’s the difference between faking, mocking, and stubbing?
- What Makes a Good Unit Test? [closed]
- When should I mock?
- Random data in Unit Tests?
- Mocking vs. Spying in mocking frameworks
- What is Mocking?
- Should I test private methods or only public ones? [closed]
- How deep are your unit tests?
- What is the purpose of mock objects?
- Mock functions in Go
- Should Private/Protected methods be under unit test? [closed]
- How do I unit-test saving file to the disk?
- How to terminate a program when it crashes? (which should just fail a unit test instead of getting stuck forever)
- Unit testing Anti-patterns catalogue
- Is UnitOfWork and GenericRepository Pattern redundant In EF 4.1 code first?
- How does mockito when() invocation work?
- Is it possible to mock a function imported from a package in golang?
- What is the best way to unit-test SLF4J log messages?
- Should it be “Arrange-Assert-Act-Assert”?
- How to mock specific methods but not all of them in Rust?
- What is a “Stub”?
- F# development and unit testing? [closed]
- How to do TDD and unit testing in powershell?
- Is it possible to mock a function imported from a package?
- Writing “unit testable” code?
- What is unit testing and how do you do it? [duplicate]
- Fill os.Stdin for function that reads from it
- Junit5 mock a static method
- Is there an easy way to stub out time.Now() globally during test?
- Testing route configuration in ASP.NET WebApi