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
115 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
393 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
45 views

Multiple Services and Test Setup

Class To Test Some methods hidden for clarity ...
0
votes
2answers
135 views

Using MOQ In Unit Testing

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
2k 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. I am new to unit testing so please bear with me. ...
1
vote
1answer
176 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
179 views
11
votes
3answers
911 views

Which Unit Test is correct? They both test the same thing in different ways

Below both Unit Tests pass and they both test the same thing. Which is the production code uses the right error codes. The short question is which test is correctly Unit Testing expected behaviour ...
5
votes
2answers
355 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
3k views

Mocking the class under test with private method calls

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