Mocking the behaviour of operators in Moq C#
问题 Hope your well. I am in the process of creating some tests using Moq in C#. One of the objects I am Mocking has overridden ==, > and < operators. Does anyone know if its possible, and if so how to... configure a Mock object to replicate this. The reason I ask is that I am trying to inject a mocked stub as some legacy code I have been given that has deep and dirty dependencies. Your time is appreciated Thanks 回答1: When you override such operations you should also provide theirs named