.net - TDD: Number of Asserts, and what to actually assert? -
i writing tests using tdd , have come against few queries. normally when writing unit tests, used use 1 assert per unit tests defined practice , easy see why test failing. in tdd, practice same, if case design 1 method using tdd going end more 1 unit test - need more 1 assert. the other concern assert ? i assert think return object ? so have create return type (could complex many properties) , ensuring these match on assert, technically 1 assert. or other way ensure mocks have made along way being called i.e. en moq following myservicemock.verify(x => x.itemsreceived(), times.once()); so can ensure method called once on mock, classed assert. goes original query, 1 assert per unit test need create additional unit tests ensure other methods on other mocks being called. what else doing here ? do assert methods called on mocks or values being returned expect. really forward input has on this. i see question has different concerns cover. first, r...