Skip to main content

All Questions

Tagged with
3 votes
1 answer
561 views

Separate Action from Assertion in Unit Tests

Setup Many years ago I took to a style of unit testing that I have come to like a lot. In short, it uses a base class to separate out the Arrangement, Action and Assertion of the test into separate ...
DigitalMoss's user avatar
1 vote
3 answers
1k views

C# / Java: Should every class have a main method?

I've been learning C# lately to see the other side of the coin (I have a decent amount of Java knowledge already) so I've been reading up on C#, and I came across an article called C# for Java ...
Bassinator's user avatar
1 vote
1 answer
127 views

Loading data for ShoppingCart item

I'm currently trying to cover our shopping cart with unit tests. Class ShoppingCartItem has property Term. It also loads available terms for this item upon object creation. Currently this is done ...
Josef Rousek's user avatar
0 votes
3 answers
434 views

Would you test this piece of configuration code? How do I determine which code is worth testing?

We have a piece of code that decorates an interface to transparently add retry logic. Inversion of Control configuration service.AddOurRestApiClient() .AddResilienceHandler("Retry", ...
LostInComputer's user avatar
-2 votes
1 answer
203 views

How do you distinguish your public API interfaces from the interfaces you use for testing/mocking?

Mocking frameworks are useful for creating mock objects that isolate the code under test from its surrounding software environment. Some mocking frameworks cannot mock non-virtual methods, so they ...
Robert Harvey's user avatar