The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
1answer
146 views

Verify collection as a method parameter

How can I verify that ohterClassMock.MethodToTest() was called with contracts? That it was called with contract, that have Id = 1 and Param2 = 34 and also with contract2, which has Id = 2 and Param2 ...
0
votes
1answer
62 views

how should you mock / unit test this method / class

I have the below code: public interface IRepositoryService { /// <summary> /// This will add conditions like Published = true, Deleted = false and PublisehdDate smaller than NOW /// ...
11
votes
3answers
781 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 ...
4
votes
3answers
146 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, void IAutoTisDal.UpdateRange(Range range) { using (var repo = ...
0
votes
1answer
683 views

Mocking the class under test with private method calls

Consider the scenario below. It covers multiple methods of my unit under test. public class OriginalSample { public bool Foo(ISomeEntity entity) { return entity.IsThatSo ? ...