NUnit historically has been the most popular .NET testing framework. IN this section i'll cover everything you need to get up and writing some basic tests.
On any .NET project you should be writing unit tests. I won't go into the benefits of unit testing here, but when you're new to unit testing, after understanding the importance of testing and deciding to get stuck in, the next thing you need to deci[...]
Today's guide is going to be very quick and simple. The actual writing of the unit test is usually pretty easy, the harder part is knowing how to write testable code, setting up/mocking the set dependencies required for your tests and also wrapping [...]
When a lot of people start unit testing, they seem to think that because the code isn't 'production' code that the unit test code doesn't really matter that much and that they can hack together something quick and dirty and it doesn't matter.
If you want to drastically cut down on the amount of boring set-up code you need to write in order to test your website, then I receommend checkign out Autofixture.
If you have ever worked on a large project using TDD, or, you've worked on a big project where the team was aiming for a very high test coverage, then you'll understand the time and effort it take to write your tests set-up code. In some instances, [...]
Writing boring boiler plate test sucks. When it comes to writing monotonous tests, I sometimes feel like I'd rather shoot myself in the foot just so I can get out of it. This hatred of doing dull repetitive tasks generally means I'm constantly Goog[...]
I've previously written about my love for Autofixture and how I'd recommend that you start using it on your project to make you drastically reduce the amount of unit testing set-up code you'll need to write. I tend to use NUnit on projects (with a l[...]
Fluent Assertions is another great tool I use when unit testing. Fluent Assertions is a simple lightweight extension that will make it eassier to read and write your tests.
Releasing a project without bugs is an essential part of every project. One of the quickest and easiest tools to help you achieve that goal are unit tests. Regardless of how high, or low your test coverage is, you should be writing unit tests. One [...]
Selenium is a popular open-source automation tool that you can use to test how your webpages look and behave. You can use Selenium with C# unit tests to ensure that you don't break pages, your forms work as expeceted etc.. This section will cover a basic introduction to get you up and running with Selenium on your project.
I think a lot of developers have heard of Selenium, however, from my experience very few teams get around to using Selenium on their projects. Like Unit Testing in general, I think most people have 'frontend' testing on their 'we SHOULD do this list[...]
If you want a semi-easy way to be able to run some front-end unit tests within your C# project, then this article is for you. I've talked previously about setting up Selenium with C# and Browserstack automate here. I've recently started using Brows[...]
When you test your code you want to test two things. That the successful route and the unsuccessful route through your method works as expected. One way of doing this is to write a unit test that checks that Log4Net has written a message. Luckily,[...]
If you want to learn how to easily write unit tests for entity framework, read on. All your entity framework code will talk to a database, which under normal test conditions will fail. Instead, to make your tests easy to write we want to hi-jack yo[...]