There were build errors. Would you like to continue and run the last successful build?

There Were Build Errors. Would You Like To Continue And Run The Last Successful Build?

Moq – Getting the Value Of a Mocked Method Parameter

moq logo

There’s scenarios where we don’t care about the Moq “It.IsAny<>” parameter value being passed into a mocked method but we need to get the value on the way out. For example, take the scenario below. I’m using SQLite to form integration tests and I…

Hide Endpoints And Schemas from Swagger / OpenAPI

Swagger

I have a requirement to hide a few of the API’s controller endpoints from Swagger along with their respective schemas that aren’t yet ready for public consumption. I still want them to be available for Postman/Newman tests as part of the CI/CD. This can…

Moq OData Delta Objects To Test Patch Methods

moq logo

Issue Following on from my afternoon with Moq I stumbled upon another fun issue. How the hell could I test my API’s PATCH methods? They all make use of OData’s Delta objects. Solution It’s actually fairly simple. You just need to create a new…

Mock a return type of Task and Tuple with Moq

moq logo

Issue Using Moq I was creating a few unit tests and stumbled across an interesting problem. I needed to mock a call to an async method on a service under test that took in a 2 parameters and returned a tuple of 2 values….