Tagged Questions

A mocking framework, used in unit tests for injecting "fake" implementations of interfaces as dependencies of the system under test. Use this tag for code reviews of unit testing methods that use this specific mocking framework.

learn more… | top users | synonyms

5
votes
2answers
205 views

Using the builder pattern to build mock objects and nested builders

No, this question has no roosting construction workers. I'm not sure if what I'm doing is a good use of the builder pattern or whether its a bastardization of what its intended purpose was. I'm ...
3
votes
1answer
675 views

Unit tests using C#, Moq, AutoFixture, FluentAssertions

Could you give any suggestion on the following unit tests? How to make it more readable, maintainable and trustworthy. If it is not a problem - post some code with the suggestions. ...
2
votes
1answer
49 views

Multiple Services and Test Setup

Class To Test Some methods hidden for clarity ...
1
vote
2answers
160 views

Using MOQ in unit-testing for a shipping calculator

I am fairly new to writing unit tests, and I was wondering if this approach I have taken is on the right track? Given the following interfaces/classes: ...
4
votes
2answers
3k views

REST Web Api unit test endpoint validity with NUnit and Moq

I am unit testing that the URL that I give to my IRestClient is valid. This client talks to a third party Web API. The test is as below: ...
1
vote
1answer
180 views

Verify collection as a method parameter

How can I verify that ohterClassMock.MethodToTest() was called with contracts? That it was called with ...
2
votes
1answer
193 views
11
votes
3answers
934 views

Unit tests for testing error codes

Both unit tests pass and they both test the same thing. The production code uses the right error codes. System Under Test (SUT) ...
5
votes
2answers
401 views

Is this UnitTest for updating an object in data-access layer sensible?

I'm still trying to learn how to write good tests (and write testable code). This is the function I want to verify, ...
0
votes
1answer
4k views

Mocking the class under test with private method calls

Consider the scenario below. It covers multiple methods of my unit under test. ...