Moq: Working With SetupGet, VerifyGet, SetupSet, VerifySet, SetupProperty
Moq has a set of methods specific to stubbing and verification of properties. In this post I’m going to go over each one of them, and explain when and why to use them. I also discuss their differences...
View ArticleIsolation Frameworks: Why FakeItEasy and NSubstitude Are Better Than Moq
I’ve been trying out different isolation frameworks lately and reading about their features and differences. In terms of feature, most constrained isolation frameworks are almost the same. But there...
View ArticleInteraction Testing With Mocks Leads To A Less Maintainable Unit Test
One of the hallmark of a good unit test is its maintainability. The test that is not maintainable is a pain and there is a higher tendency for it to be ignored. One of the mistakes in software testing...
View ArticleShare Expensive Object Between Tests By IClassFixture
When XUnit run a test method, it’s going to create a new object of our test class for each and everyone of our test method. This can create a problem when the creation of the object is expensive and...
View ArticlexUnit: Share an SUT Instance Between Two Class Using Collection
In my previous post I talked about how we can Share Expensive Object Between Tests By Using IClassFixture. My previous post is about situations when we want to share a class instance between all test...
View ArticlexUnit: Control the Test Execution Order
Sometime in our tests, we need to control the test execution order. This mostly happens in our integration test and not as often as our unit tests. Some people might even argue that controlling the...
View ArticlexUnit BeforeAfterTestAttribute: How to Run Code Before And After Test
Sometimes we need to run a piece of custom code before and after a test and set of tests. One example of this might be when we want to change the thread culture. In this case we change it before test...
View ArticleMoq: What’s Wrong With Using VerifyAll
There are some features in the isolation framework (Mocking framework) Moq which I see is used blindly. Most of the time it can which reduce test readability and maintainability. One of the worst...
View ArticleThe Right Balance Between Different Types Of Test
Testing strategy is one of those topic that can get very tricky to figure out at the start of project. What I mean is every project depending on the type, needs a specific type of test more than...
View ArticleHow to Choose a Good Software Testing Strategy
Previously I wrote an article titled The Right Balance Between Different Types Of Test. This article in intended to act as a complementary piece that will help us to make a better choice when it comes...
View Article