Extension methods are just static methods in disguise. Mocking frameworks like Moq or Rhinomocks can only create mock instances of objects, this means mocking static methods is not possible.
More Related Contents:
- Mocking Extension Methods with Moq
- How do I mock the HttpContext in ASP.NET MVC using Moq?
- Mocking Static Methods
- How to mock static methods in c# using MOQ framework?
- Is it possible to mock out a .NET HttpWebResponse?
- Using Moq to determine if a method is called
- Moq: unit testing a method relying on HttpContext
- Mocking generic methods in Moq without specifying T
- How to mock Controller.User using moq
- Mocking using Moq in c#
- Distinct() with lambda?
- Using IoC for Unit Testing
- Impossible to use ref and out for first (“this”) parameter in Extension methods?
- How do you mock out the file system in C# for unit testing?
- Why doesn’t Include have any effect?
- Will the dynamic keyword in C#4 support extension methods?
- Can I “multiply” a string (in C#)?
- Why can’t I call an extension method from a base class of the extended type?
- How to mock ConfigurationManager.AppSettings with moq
- AddRange to a Collection
- Why does the property I want to mock need to be virtual?
- How to test method call order with Moq
- What is the difference between passing It.IsAny() and the value of It.IsAny() to a method setup
- Extension method priority
- Moq – Non-overridable members may not be used in setup / verification expressions
- Using extension methods in .NET 2.0?
- Warm-up when calling methods in C#
- Using Moq to override virtual methods in the same class
- Is it possible to extend arrays in C#?
- How to (should I) mock DocumentClient for DocumentDb unit testing?