testing (5)


How to test WebAPI with In-Memory Hosting

In most cases you want to have integration tests for your WebAPI, but don’t deploy it on IIS. There is an option which allows to skip IIS pipeline and work only with ASP.NET one. You may create an HTTP server in memory and call the same endpoints as usual. This is easy and allows to cover […]




How To: Inject custom HTTP headers with Fiddler

When you’re testing a web service or web site with authentication credentials posted via HTTP headers, you might want a way to inject testing credentials without login in. Fiddler could help with that, but its rules need to be configured. Below I’ll describe how to do that Fiddler v4.5 (did not experiment in earlier versions).




Executing SQL script with GO statement from C# code

In the middle of a project you might want to automate DB restoring and upgrading  by means of existing SQL scripts which may contain GO-statements. If you are that person who is attempting to execute scripts at runtime with GO-statements, this article describes how to do that.




Data-driven test with xUnit

In some cases it’s very challenging to recreate all data for some use case. It much easier to run the application, create some starting point: people, products, orders, prices, amounts, etc. and use such DB during tests. Automated tests should restore such DB in a test sandbox, run tests and drop the DB. All test frameworks have possibility to run some […]




Choosing of the unit testing framework (xUnit, NUnit, MSTest)

Is xUnit is a modern and future proof solution for unit testing? I’m measuring pros and cons of xUnit and NUnit for the big and old legacy application. At the first go I thrown away MsTest because the more efforts are required to do the same things. Also it is not as extendible as others. […]