tests

Testing your code part 3 – ClassData and MemberData

In the previous article we’ve seen how to use the [Theory] attribute with [InlineData], which allow us to have static elements to feed our tests methods. This particular approach can bring lots of noise inside our code, especially when dealing with 10 or more test methods in the same class. In this article we’ll see how to use [ClassData] and [MemberData] attributes …

Testing your code part 3 – ClassData and MemberData Read More »

Testing your code part 2 – Theories and InlineData

In the last article we introduced xUnit.net and talked about the very basic way to write tests with the [Fact] attribute. Today will we’ll add some spicy to our tests with the [Theory] attribute. The [Theory] attribute allows you to dynamically pass a set of data to your test method and to execute a test for every given set. This way …

Testing your code part 2 – Theories and InlineData Read More »