I am simply trying to mock an extension method on an Enum and no matter how I set it up I always seem to get a "Object reference not set to an instance of an object." error. Here is my code:
The extension method (ToType) is just a switch statement that maps enum values to Types. I also tried using a mock for the invalidType.
var invalidType =
new
MyEnum();
Mock.Arrange(() => invalidType.ToType()).Returns((System.Type)
null
);
The extension method (ToType) is just a switch statement that maps enum values to Types. I also tried using a mock for the invalidType.