Top "Tdd" questions

Test-Driven Development (TDD) involves writing a failing automated test to specify what is to be built.

Moq - mock.Raise should raise event in tested unit without having a Setup

I have a presenter class, that attaches an event of the injected view. Now I would like to test the …

c# events tdd moq mvp
PHPUnit: expects method meaning

When I create a new mock I need to call the expects method. What exactly it does? What about its …

php unit-testing tdd mocking phpunit
Jest: how to mock console when it is used by a third-party-library?

I am trying to mock console.warn/error but i can't. I use a third-party-library which calls console.warn inside …

javascript unit-testing tdd jestjs
Moq - How to verify that a property value is set via the setter

Consider this class: public class Content { public virtual bool IsCheckedOut {get; private set;} public virtual void CheckOut() { IsCheckedOut = true; } public …

c# .net mocking tdd moq
Random data in Unit Tests?

I have a coworker who writes unit tests for objects which fill their fields with random data. His reason is …

unit-testing tdd mocking
NSURL to file path in test bundle with XCTest

I am trying to write an iOS app using TDD and the new XCTest framework. One of my methods retrieves …

ios tdd nsbundle xctest
How do you mock the session object collection using Moq

I am using shanselmann's MvcMockHelper class to mock up some HttpContext stuff using Moq but the issue I am having …

asp.net-mvc unit-testing tdd moq
How do you mock a Sealed class?

Mocking sealed classes can be quite a pain. I currently favor an Adapter pattern to handle this, but something about …

unit-testing language-agnostic tdd mocking
What is the expected syntax for checking exception messages in MiniTest's assert_raises/must_raise?

What is the expected syntax for checking exception messages in MiniTest's assert_raises/must_raise? I'm trying to make an …

ruby tdd minitest assertion
How to test JSON result from Ruby on Rails functional tests?

How can I assert my Ajax request and test the JSON output from Ruby on Rails functional tests?

ruby-on-rails json tdd