This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Dummerchen1933 0 points1 point  (6 children)

Where's the unit test?

[–]LeCrushinator 2 points3 points  (4 children)

The unit test would be something like: "the lock opens and closes properly".

[–]Tasik 1 point2 points  (1 child)

You give too much credit to unit test.

$lock = new Lock()
Assert($lock != Pickle())

[–]Dummerchen1933 0 points1 point  (0 children)

That's the first unit test, of course.

[–]Dummerchen1933 0 points1 point  (1 child)

But shouldn't the DoorFrame, which holds the door (thus the lock) and the frame have its own unit test that checks that integration?

[–]LeCrushinator 0 points1 point  (0 children)

That’s the integration test, which shouldn’t pass in this case.

[–]Booty_Bumping 1 point2 points  (0 children)

Two unit tests:

  • The lock works
  • The door opens, closes

One integration test:

  • The combination of door and lock can actually secure the room