Loading ...
Sorry, an error occurred while loading the content.

Re: [XP] Testing Leftover

Expand Messages
  • Ron Jeffries
    ... If we know that A works correctly, we re not dealing with the questioner s case, which is what if you need to test a private method . Ron Jeffries
    Message 1 of 48 , Jun 1, 2004
    • 0 Attachment
      On Tuesday, June 1, 2004, at 2:35:10 AM, Lior Fridman wrote:

      > But I want to test class B and not A
      > I know that A behaves correctly (it has its own tests)

      > So I don't think that replacing B with a mock class willl help me test
      > class B.

      If we know that A works correctly, we're not dealing with the questioner's
      case, which is "what if you need to test a private method".

      Ron Jeffries
      www.XProgramming.com
      Questioner: How do I sell my executive team on doing this stuff?
      Jim Highsmith: Don't. Just do it. They don't know what you're doing anyway.
    • J. B. Rainsberger
      ... If A behaves correctly, and if testing B with a real A is painful, then consider mocking A when testing B. Simple. -- J. B. Rainsberger, Diaspar Software
      Message 48 of 48 , Jun 2, 2004
      • 0 Attachment
        Lior Fridman wrote:

        > But I want to test class B and not A
        >
        > I know that A behaves correctly (it has its own tests)
        >
        > So I don't think that replacing B with a mock class willl help me test
        > class B.

        If A behaves correctly, and if testing B with a real A is painful, then
        consider mocking A when testing B. Simple.
        --
        J. B. Rainsberger,
        Diaspar Software Services
        http://www.diasparsoftware.com :: +1 416 791-8603
        Let's write software that people understand
      Your message has been successfully submitted and would be delivered to recipients shortly.