WireMock.NET allows for easy testing of the code that makes HTTP requests, without having to rely on the actual external service being available and without hacking HttpClient.
In this article, I’ll delve into the process of mocking dependencies in a DI container when using WebApplicationFactory, and offer some insights and best practices I’ve learned along the way.
Sztuka programowania 695 dni, 1 godzinę, 19 minut temu 90 źrodło rozwiń
In one of our projects, we recently started using Cypress for end-to-end testing. Cypress executes tests written in JavaScript or TypeScript. However, we wanted to first perform some data-preparation operations using C#. In fact, we needed to run Cypress tests from NUnit C# tests. In this article, I’m sharing how this can be done 🙂 It will also be useful if you use another testing framework than NUnit, but the examples are based on it. Table of...
Sztuka programowania 1165 dni, 2 godziny, 29 minut temu 42 źrodło rozwiń
In the “classical unit tests” developers quite often use Arrange/Act/Assert comments to annotate the main parts of the test method script. However, the test case scenarios in component tests tend to be more complex and those simple notations don’t fit anymore. Here's my proposition on how to deal with that problem...
Sztuka programowania 1214 dni, 3 godziny, 36 minut temu 64 źrodło rozwiń
LukaszPosted on Imagine you’re starting to develop a new feature… and this time you decide to do it right. So, you started with Test-Driven development, because it’s part of your ethic to write tests (a surgeon never asks whether they should wash their hands before an surgery). It felt so good. And it felt so right. You’re satisfied with your code design and the fact that you’ve started with tests. And hey, the code coverage is pretty good too! You deployed this code to production and it is working rea...
Sztuka programowania 1334 dni, 3 godziny, 12 minut temu 48 źrodło rozwiń
In this blog post I’m going to share my experience on testing ASP.NET Core applications with applying unconventional method called snapshot assertions. In comparison to the classical approach this method should save you a lot of time and improve assertions maintainability.
Reading time ~7 minutes This article is Part 3 in a 3-Part Series. Part 1 - Refactoring to Data Driven TestsPart 2 - How to get data for Data-Driven Tests?Part 3 - This Article As promised here and here, this will be tips, tricks, and good practices for data-driven tests. If You want to know more about data-driven testing see my previousposts on this topic. Here we go. I will be converting this series into an ebook with additional source code and examples. If You want to get it please subscribe:G...
Sztuka programowania 1918 dni, 3 godziny, 31 minut temu 53 źrodło rozwiń
Reading time ~6 minutes This article is Part 2 in a 2-Part Series. Part 1 - Refactoring to Data Driven TestsPart 2 - This Article The previous post was meant to be an encouragement and a warmup to data-driven testing. This post describes why I love this way of testing. Understanding a simple fact about testing moved me from “Oh, I should write tests” to “I want it all! And I want it now!” and Data-Driven Testing. And the simple truth is: Anyone who is a bit interested in machine learning heard sta...
Sztuka programowania 1922 dni, 4 godziny, 14 minut temu 59 źrodło rozwiń
W poprzednim wpisie wspomniałam o narzędziu Cypress, które umożliwia nam uruchamianie testów z poziomu przeglądarki dzięki czemu bardzo przyjemnie się z nim pracuje. Dziś pokażę Wam jak pisać testy i jak je uruchamiać.
Developer’s job is far beyond designing, writing the code and testing it. One of the important responsibilities is to ship the code to production. How to do that safely?
Architektura 2602 dni, 5 godzin, 50 minut temu 117 źrodło rozwiń
Od ponad roku rozwijam framework do automatyzacji testów. Przez ten czas miałem okazję pracować przy kilku projektach związanych z automatyzacją, gdzie poznałem wspaniałych ludzi i za każdym razem miałem okazję spojrzeć na testowanie automatyczne z innej perspektywy. Widziałem kod doskonały (tak, istnieją takie! :)) oraz taki, o którym chciałbym jak najszybciej zapomnieć. Dzisiaj skupię się na tym drugim i przedstawię wam 3 sprawdzone sposoby na to, jak zepsuć testy automatyczne...
Sztuka programowania 2686 dni, 14 godzin, 49 minut temu 214 źrodło rozwiń
Introduction to my new course about testing
Article about automating web application accessibility testing using Selenium WebDriver
Propsuje jedno z moich ulubionych narzedzi w codziennej pracy w VisualStudio
Jak tworzyc dane testowe przy pomocy biblioteki AutoFixture oraz tworzenie mock'ów w testach z FakeItEasy
Daj się poznać 2016 3143 dni, 2 godziny, 32 minuty temu 61 źrodło rozwiń
Recently I’ve had this idea that came into my mind while working on the Sentry – let the users of my library (if there will be any) to configure not only the set of rules, connection strings, urls etc. but also the underlying providers that do all of the heavy lifting (e.g. the HttpClient responsible for communicating with the API). It means that as long as you’re not satisfied with the default solution, please feel free to provide your own engine that will for example talk to the database and perform a ...
Sztuka programowania 3174 dni, 2 godziny, 33 minuty temu 84 źrodło rozwiń
If we think about advanced website development, sooner or later we’ll deal with JavaScript Task Runners. One of them is Gulp – a library available in NPM, which enables us to significantly automate our work. Gulp facilitates a compilation of Sass or Less files to CSS format; it allows to use Autoprefixer (a tool that will ensure the compatibility of our CSSs with multiple browsers) as well as to watch the progress of our work in many browsers/ devices in real time.
During this year’s Testwarez 2015, we had opportunity to lead a panel discussion about testing in agile teams.
Remember that this post is not about why we should automate our functional tests. It is also not about technical details of writing tests in any particular programming language or by using any particular framework.Initial investigations Before we start writing any code we should think about best possible technical solution. The goal of this article is not to encourage using any specific framework or library. However, some crucial aspects should be considered here. First of all, we should think about o...
Ask yourself a question if your unit test project is a mixture of test methods or it shapes a specification that you can share with your client. If you really want to improve your testing experience look at NSpec.