Ale, music and enjoying life.
Mocking a Cast on a Mocked Interface The Setup var mockedInterface = new Mock<IInterface>(); mockedInterface.As().Setup(i => i.MethodOnTheInterface()); Easy as that! Been working with Moq a fair bit recently. Some other Moq tips and tricks here.
Was going down a rabbit hole trying to figure out how to check param value on a mocked method (pretty simple if truth be told). I need to ensure that when an exception was raised my logger would be called Times.Once and would log the…
Was converting a series of unit tests from MsTest to Nunit (due to TeamCity constraints with MsTest). Was scratching my head for a while – Coulda sworn Nunit supports the ExpectedException attribute. Quick google and it does – Look! there in the official Nunit…