From: Steve F. <sm...@us...> - 2001-11-18 21:06:27
|
Update of /cvsroot/mockobjects/doc In directory usw-pr-cvs1:/tmp/cvs-serv8984 Modified Files: another_route.html Log Message: Index: another_route.html =================================================================== RCS file: /cvsroot/mockobjects/doc/another_route.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- another_route.html 2001/08/28 22:58:19 1.3 +++ another_route.html 2001/11/18 21:06:24 1.4 @@ -7,7 +7,7 @@ .deemphasised { color: #666666} h1 { text-align: center; font-family: Arial, Helvetica, sans-serif; font-weight: bold} h3 { font-family: Arial, Helvetica, sans-serif; font-style: italic; font-weight: bold; font-size: small} -.inline_code { font-family: "Courier New", Courier, mono; font-style: normal; font-size: smaller; vertical-align: middle} +.inline_code { font-family: "Courier New", Courier, mono; font-style: normal; font-size: small; vertical-align: middle} p { font-family: Arial, Helvetica, sans-serif} li { font-family: Arial, Helvetica, sans-serif } h2 { font-family: Arial, Helvetica, sans-serif; margin-top: 3%} @@ -38,6 +38,7 @@ <pre> public void testReminderEmailSent() throws ServletException, IOException { mockRequest.setupAddParameter(ForgotPasswordServlet.EMAIL_PARAM, EMAIL); + mockReminder.setExpectedEmailAddress(EMAIL); mockResponse.setExpectedRedirect(SENT_URI + "?email=" + EMAIL); @@ -109,14 +110,21 @@ <h3>Differences</h3> <p>There are two obvious differences to the original so far. First, we start at the top level of the problem, from outside the servlet, rather than from an - internal object. Second, we perfer to pass our test infrastructure into the + internal object. Second, we prefer to pass our test infrastructure into the target code, as Mock Objects, rather than use techniques such as inner classes to give us access to private data. This means that we tend to define our assertions at the beginning of test, rather than at the end.</p> -<h2>More functionality</h2> +<h2>Handling failure</h2> +<h3>Cannot send an email</h3> +<p>Sending an email may fail, perhaps because a connection has failed or because + an address is not well-formed; we will handle this by redirecting the user to + a suitable error page. To </p> +<h3> </h3> <h3>No record for the email address</h3> <p>People are likely to request passwords for email addresses that are not in - the database, either by accident or maliciously. </p> + the database, either by accident or maliciously. Our response will be to redirect + users who specify an incorrect email address to </p> +<h3>Test Bad Email</h3> <hr> <p>© Steve Freeman, 2001</p> <p> </p> |