flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r902467 [3/10] - in /websites/staging/flex/trunk: cgi-bin/ content/ content/flexunit/ content/flexunit/tutorial/ content/flexunit/tutorial/css/ content/flexunit/tutorial/flexunit/ content/flexunit/tutorial/images/ content/flexunit/tutorial/...
Date Thu, 20 Mar 2014 03:56:22 GMT
Modified: websites/staging/flex/trunk/content/download-utilities.html
==============================================================================
--- websites/staging/flex/trunk/content/download-utilities.html (original)
+++ websites/staging/flex/trunk/content/download-utilities.html Thu Mar 20 03:56:18 2014
@@ -12,20 +12,20 @@
     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
     <link href='https://fonts.googleapis.com/css?family=Carrois+Gothic' rel='stylesheet' type='text/css'>
     <!-- CSS -->
-    <link rel="stylesheet" type="text/css" href="css/bootstrap.css">
-    <link rel="stylesheet" type="text/css" href="css/fixed-width.css" id="layout">
-    <link rel="stylesheet" type="text/css" href="css/style.css">
+    <link rel="stylesheet" type="text/css" href="/css/bootstrap.css">
+    <link rel="stylesheet" type="text/css" href="/css/fixed-width.css" id="layout">
+    <link rel="stylesheet" type="text/css" href="/css/style.css">
 
     <!-- Java Script  -->
-    <script src="js/jquery.js"></script>
-    <script src="js/custom.js"></script>
-    <script src="js/selectnav.js"></script>
-    <script src="js/flexslider.js"></script>
-    <script src="js/twitter.js"></script>
-    <script src="js/fancybox.js"></script>
-    <script src="js/isotope.js"></script>
-    <script src="js/bootstrap.js"></script>
-    <script src="js/showcase.js"></script>
+    <script src="/js/jquery.js"></script>
+    <script src="/js/custom.js"></script>
+    <script src="/js/selectnav.js"></script>
+    <script src="/js/flexslider.js"></script>
+    <script src="/js/twitter.js"></script>
+    <script src="/js/fancybox.js"></script>
+    <script src="/js/isotope.js"></script>
+    <script src="/js/bootstrap.js"></script>
+    <script src="/js/showcase.js"></script>
 
     <!-- Google Analytics -->
     <script type="text/javascript">
@@ -61,7 +61,7 @@
             <!-- Logo -->
             <div class="span5">
 
-                <a href="#"><img src="images/logo_01_fullcolor-sm.png" alt="Apache Flex®" title="Apache Flex®" /></a>
+                <a href="#"><img src="/images/logo_01_fullcolor-sm.png" alt="Apache Flex®" title="Apache Flex®" /></a>
 
             </div>
 
@@ -91,20 +91,20 @@
                 <li><a href="#">About Flex</a>
                     <ul>
 
-                        <li><a href="about-whatis.html">What is Flex?</a></li>
-                        <li><a href="about-features.html">Features</a></li>
-                        <li><a href="about-licensing.html">License &amp; Trademarks</a></li>
-                        <li><a href="about-people.html">The Team</a></li>
-                        <li><a href="about-history.html">Project History</a></li>
-                        <li><a href="about-assets.html">Logo and Assets</a></li>
+                        <li><a href="/about-whatis.html">What is Flex?</a></li>
+                        <li><a href="/about-features.html">Features</a></li>
+                        <li><a href="/about-licensing.html">License &amp; Trademarks</a></li>
+                        <li><a href="/about-people.html">The Team</a></li>
+                        <li><a href="/about-history.html">Project History</a></li>
+                        <li><a href="/about-assets.html">Logo and Assets</a></li>
                     </ul>
                 </li>
                 <li><a href="#">Community</a>
                     <ul>
 
-                        <li><a href="community-getinvolved.html">How to get involved</a></li>
-                        <li><a href="community-mailinglists.html">Mailing Lists</a></li>
-                        <li><a href="community-showcase.html">Flex Showcase</a></li>
+                        <li><a href="/community-getinvolved.html">How to get involved</a></li>
+                        <li><a href="/community-mailinglists.html">Mailing Lists</a></li>
+                        <li><a href="/community-showcase.html">Flex Showcase</a></li>
                         <li><a href="https://cwiki.apache.org/confluence/display/FLEX/Apache+Flex+Wiki">Wiki <i class="icon-share icon-white"></i></a></li>
                         <li><a href="http://blogs.apache.org/flex/">Blog <i class="icon-share icon-white"></i></a></li>
                     </ul>
@@ -112,8 +112,8 @@
 
                 <li><a href="#">Development</a>
                     <ul>
-                        <li><a href="dev-faq.html">Developer FAQ</a></li>
-                        <li><a href="dev-sourcecode.html">Source Code</a></li>
+                        <li><a href="/dev-faq.html">Developer FAQ</a></li>
+                        <li><a href="/dev-sourcecode.html">Source Code</a></li>
                         <li><a href="https://issues.apache.org/jira/browse/FLEX">Bug-Tracker <i class="icon-share icon-white"></i></a></li>
                     </ul>
                 </li>
@@ -121,9 +121,9 @@
                 <li><a href="#">Documentation</a>
                     <ul>
 
-                        <li><a href="doc-getstarted.html">Getting Started</a></li>
-                        <li><a href="doc-videos.html">Videos</a></li>
-                        <li><a href="asdoc/index.html">ASDocs <i class="icon-share icon-white"></i></a></li>
+                        <li><a href="/doc-getstarted.html">Getting Started</a></li>
+                        <li><a href="/doc-videos.html">Videos</a></li>
+                        <li><a href="/asdoc/">ASDocs</a></li>
                         <li><a href="http://help.adobe.com/en_US/flex/using/index.html">Documentation Reference (Old) <i class="icon-share icon-white"></i></a></li>
 
                     </ul>
@@ -142,11 +142,11 @@
                 <li><a href="#" class="download">Download</a>
                     <ul>
 
-                        <li><a href="installer.html">Download the SDK Installer (For Application Developers)</a></li>
-                        <li><a href="download-binaries.html">Download the SDK Binaries (For SDK Developers)</a></li>
-                        <li><a href="download-source.html">Download the SDK Source Code (For SDK Developers)</a></li>
-                        <li><a href="download-utilities.html">Download Utilities</a></li>
-                        <li><a href="download-archive.html">Previous Versions</a></li>
+                        <li><a href="/installer.html">Download the SDK Installer (For Application Developers)</a></li>
+                        <li><a href="/download-binaries.html">Download the SDK Binaries (For SDK Developers)</a></li>
+                        <li><a href="/download-source.html">Download the SDK Source Code (For SDK Developers)</a></li>
+                        <li><a href="/download-utilities.html">Download Utilities</a></li>
+                        <li><a href="/download-archive.html">Previous Versions</a></li>
                     </ul>
                 </li>
             </ul>
@@ -254,8 +254,8 @@
         <!-- Latest Releases -->
         <div class="span3">
             <div class="footer-headline"><h4>Latest Releases</h4></div>
-            <p>Apache Flex SDK : <a href="download-binaries.html">4.12.0 (Mar 2014)</a><br />
-                SDK Installer : <a href="installer.html">2.7.0 (Oct 2013)</a><br />
+            <p>Apache Flex SDK : <a href="/download-binaries.html">4.12.0 (Mar 2014)</a><br />
+                SDK Installer : <a href="/installer.html">2.7.0 (Oct 2013)</a><br />
                 BlazeDS : <a href="http://sourceforge.net/adobe/blazeds/wiki/Home/">4.6.0 (Nov 2011)</a><br />
                 Flex Mavenizer : <a href="http://svn.apache.org/viewvc/flex/utilities/trunk/mavenizer/"> 4.8.0 (Jan 2013)</a></p>
         </div>

Added: websites/staging/flex/trunk/content/flexunit/tutorial/css/Vegur-Bold.eot
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/flex/trunk/content/flexunit/tutorial/css/Vegur-Bold.eot
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: websites/staging/flex/trunk/content/flexunit/tutorial/css/Vegur-Light.eot
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/flex/trunk/content/flexunit/tutorial/css/Vegur-Light.eot
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: websites/staging/flex/trunk/content/flexunit/tutorial/css/Vegur-Medium.eot
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/flex/trunk/content/flexunit/tutorial/css/Vegur-Medium.eot
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: websites/staging/flex/trunk/content/flexunit/tutorial/css/Vegur-Regular.eot
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/flex/trunk/content/flexunit/tutorial/css/Vegur-Regular.eot
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: websites/staging/flex/trunk/content/flexunit/tutorial/css/Vegur_B_0602.otf
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/flex/trunk/content/flexunit/tutorial/css/Vegur_B_0602.otf
------------------------------------------------------------------------------
    svn:mime-type = application/vnd.ms-opentype

Added: websites/staging/flex/trunk/content/flexunit/tutorial/css/Vegur_L_0602.otf
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/flex/trunk/content/flexunit/tutorial/css/Vegur_L_0602.otf
------------------------------------------------------------------------------
    svn:mime-type = application/vnd.ms-opentype

Added: websites/staging/flex/trunk/content/flexunit/tutorial/css/Vegur_M_0602.otf
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/flex/trunk/content/flexunit/tutorial/css/Vegur_M_0602.otf
------------------------------------------------------------------------------
    svn:mime-type = application/vnd.ms-opentype

Added: websites/staging/flex/trunk/content/flexunit/tutorial/css/Vegur_R_0602.otf
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/flex/trunk/content/flexunit/tutorial/css/Vegur_R_0602.otf
------------------------------------------------------------------------------
    svn:mime-type = application/vnd.ms-opentype

Added: websites/staging/flex/trunk/content/flexunit/tutorial/css/style.css
==============================================================================
--- websites/staging/flex/trunk/content/flexunit/tutorial/css/style.css (added)
+++ websites/staging/flex/trunk/content/flexunit/tutorial/css/style.css Thu Mar 20 03:56:18 2014
@@ -0,0 +1,402 @@
+@CHARSET "ISO-8859-1";
+
+@font-face {
+	font-family: Vegur;
+	src: url('Vegur-Regular.eot'); /* IE */
+	src: url('/css/Vegur_R_0602.otf') format("opentype");
+}
+
+body
+{
+	margin: 0;
+	padding: 0;
+	font-family: Arial, Helvetica, sans-serif;
+	letter-spacing: 0px;
+	background: url(../images/bg_body_blue.png) no-repeat top center #034963;
+}
+
+h1
+{
+	font-size: 32px;
+	font-family: Arial, Helvetica, sans-serif;
+	color: #034963;
+	display: inline;
+	margin: 0;
+}
+
+h2, h3
+{
+	font-family: Arial, Helvetica, sans-serif;
+	color: #034963;
+}
+
+p
+{
+	font-size: 18px;
+	color: #343434;
+}
+
+p.caption
+{
+	text-align: center;
+	position: relative;
+	top: -10px;
+	font-size: 0.85em;
+}
+
+pre
+{
+	background-color: #f1f1f1;
+	border-color: #dfdfdf;
+	border-width: thin;
+	border-style: solid;
+}
+
+code
+{
+	font-size: 14px;
+}
+
+ol pre,ul pre
+{
+	font-size: 14px;
+}
+
+li
+{
+	margin: 10px;
+	font-size: 18px;
+	color: #343434;
+}
+
+#container
+{
+	width: 1024px;
+	margin: 0 auto;
+	background-color: #ffffff;
+}
+
+#header
+{
+	padding: 5px;
+	height: 150px;
+	background-color: #ffffff;
+}
+
+#logo
+{
+	position: relative;
+	top: 10px;
+	padding: 10px;
+}
+
+#unitdownload
+{
+	padding-top: 70px;
+	padding-left: 50px;
+}
+
+#content
+{
+	padding-top: 20px;
+	padding-left: 23px;
+	padding-bottom: 20px;
+	width: 875px;
+}
+
+a.contentlink {font-size: 18px;}
+a.contentlink:link {color: #0000aa;}
+a.contentlink:visited {color: #551188;}
+a.contentlink:hover {color: #2288aa;}
+a.contentlink:active {color: #;}
+
+#content img
+{
+	display: block;
+	margin-left: auto;
+	margin-right: auto;
+	max-width: 850px;
+}
+
+#contentborder
+{
+	background-image: url('../images/banner.png');
+	background-repeat: no-repeat;
+	margin-left: 20px;
+}
+
+#indexborder
+{
+	background-image: url('../images/border_header.png');
+	background-repeat: no-repeat;
+	margin-left: 20px;
+	padding-top: 100px;
+}
+
+#footer
+{
+	position: relative;
+	clear: both;
+	background: #ffffff;
+	padding-bottom: 10px;
+	top: 30px;
+	text-align: center;
+}
+
+#indexfooter
+{
+	position: relative;
+	clear: both;
+	background: #ffffff;
+	padding-bottom: 10px;
+	margin-top: 200px;
+	text-align: center;
+}
+
+#footer p, #indexfooter p
+{
+	font-size: 10px;
+	font-family: Arial, Helvetica, sans-serif;
+}
+
+#sitenav
+{
+	float: right;
+	padding-right: 57px;
+}
+
+#sitenav a
+{
+	float: right;
+}
+
+#learnmore
+{
+	padding-top: 1px;
+	padding-bottom: 1px;
+	position: relative;
+	background-color: #aaaaaa;
+	top: 150px;
+}
+
+#learnmore p
+{
+	text-align: center;
+	font-size: 22px;
+	color: 	#034963;
+}
+
+#learnmore a {text-decoration: none;}
+#learnmore a:link {color: #034963;}
+#learnmore a:hover {color: #ffffff;}
+
+#footnav
+{
+	background-color: #ffffff;
+	margin-top: 30px;
+	margin-left: 112px;
+	margin-right: 112px;
+	width: 800px;
+	height: 82px;
+}
+
+#tutorialbanner
+{
+	position: relative;
+	left: -108px;
+	margin-top: 50px;
+	width: 1239px;
+	
+}
+
+/************************************************************
+*****				TRAINING CLASSES					*****
+************************************************************/
+
+#trainingleft
+{
+	float: left;
+	font-style: italic;
+	padding: 50px 40px 0px;
+	width: 268px;
+}
+
+#trainingleft p
+{
+	font-size: 17px;
+}
+
+#trainingright
+{
+	float: right;
+	margin-top: 0px;
+	margin-right: 60px;
+	width: 616px;
+	height: 518px;
+	background-image: url('../images/training/onsite_training_dottedline.png');
+	background-repeat: no-repeat;
+}
+
+#trainingrightcontent
+{
+	position: relative;
+	top: 80px;
+	left: 20px;
+	width: 576px;
+	
+}
+
+#trainingrightcontent li
+{
+	font-size: 16px;
+}
+
+#trainingbanner
+{
+	position: relative;
+	left: -102px;
+	margin-top: 40px;
+	width: 1228px;
+	
+}
+
+/************************************************************
+*****				TUTORIAL ROLLOVERS					*****
+************************************************************/
+
+a.flexunit
+{
+	display: block;
+	float: left;
+	margin-top: 100px;
+	margin-bottom: 100px;
+	margin-left: 75px;
+	width: 511px;
+	height: 280px;
+	background: url('../images/tutorial_home/Tutorial_link_default.png');
+}
+
+a.flexunit:hover
+{
+	background: url('../images/tutorial_home/Tutorial_link_hover.png');
+}
+
+#download_all
+{
+	float:right;	
+}
+
+/************************************************************
+*****				NAVIGATION ROLLOVERS				*****
+************************************************************/
+
+a.main
+{
+	display: block;
+	width: 196px;
+	height: 68px;
+	background: url('../images/Navigation/main_default.png');
+}
+
+a.main:hover
+{
+	background: url('../images/Navigation/main_rllvr.png');
+}
+
+a.training
+{
+	display: block;
+	width: 196px;
+	height: 68px;
+	background: url('../images/Navigation/training_default.png');
+}
+
+a.training:hover
+{
+	background: url('../images/Navigation/training_rllvr.png');
+}
+
+a.tutorial
+{
+	display: block;
+	width: 195px;
+	height: 68px;
+	background: url('../images/Navigation/tutorials_default.png');
+}
+
+a.tutorial:hover
+{
+	background: url('../images/Navigation/tutorials_rllvr.png')
+}
+
+/************************************************************
+*****				   FOOTER ROLLOVERS					*****
+************************************************************/
+
+a.prev
+{
+	float: left;
+	width: 148px;
+	height: 72px;
+	background: url('../images/back_default.png');
+}
+
+a.prev:hover
+{
+	background: url('../images/back_rllvr.png');
+}
+
+a.indexbutton
+{
+	float: left;
+	margin-right: 170px;
+	margin-left: 170px;
+	width: 168px;
+	height: 72px;
+	background: url('../images/Chapter_index.png');
+}
+
+a.firstindexbutton
+{
+	float: right;
+	margin-right: 171px;
+	width: 168px;
+	height: 72px;
+	background: url('../images/Chapter_index.png');
+}
+
+a.next
+{
+	float: right;
+	width: 143px;
+	height: 72px;
+	background: url('../images/next_default.png');
+}
+
+a.next:hover
+{
+	background: url('../images/next_rllvr.png');
+}
+
+/************************************************************
+*****				  FLEXUNIT ROLLOVERS	 			*****
+************************************************************/
+
+a.units
+{
+	font-family: Vegur, Arial, Helvetica, sans-serif;
+	font-size: 22px;
+	display: block;
+	width: 971px;
+	padding: 7px 0px 7px 10px;
+	background-color: #ffffff;
+	color: #545454;
+	text-decoration: none;
+}
+
+a.units:hover
+{
+	background-color: #77a3b5;
+	color: #ffffff;
+}
+

Added: websites/staging/flex/trunk/content/flexunit/tutorial/flexunit/Introduction.html
==============================================================================
--- websites/staging/flex/trunk/content/flexunit/tutorial/flexunit/Introduction.html (added)
+++ websites/staging/flex/trunk/content/flexunit/tutorial/flexunit/Introduction.html Thu Mar 20 03:56:18 2014
@@ -0,0 +1,94 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+	
+	<title>Introduction</title>
+
+	<script language="JavaScript" src="../scripts/jquery-1.5.min.js" ></script>
+	<link href="../css/style.css" rel="stylesheet" type="text/css" />
+
+</head>
+<body>
+	
+	<div id="container">
+		
+		<div id="contentborder">
+			<div id="unitdownload">
+				
+				
+			</div>			
+			<div id="content">
+				<h1 id='introduction'>Introduction</h1>
+
+<h2 id='understanding_the_course_format'>Understanding the Course Format</h2>
+
+<p>This course is divided into units, most of which present new information and contain walkthroughs. At the end of each unit, you will find a summary of the unit&#8217;s content. The following are used throughout the guide:</p>
+
+<ul>
+<li><strong>Concepts</strong> introduce new information.</li>
+
+<li><strong>Demonstrations</strong> illustrate new concepts.</li>
+
+<li><strong>Walkthroughs</strong> guide you through procedures.</li>
+
+<li><strong>Summaries</strong> provide a brief synopsis of the unit&#8217;s content.</li>
+</ul>
+
+<h2 id='reviewing_the_course_prerequisites'>Reviewing the Course Prerequisites</h2>
+
+<p>To gain the most from this class, you should already:</p>
+
+<ul>
+<li>Be comfortable building applications in Flex</li>
+
+<li>Be familiar with both AS3 and MXML</li>
+</ul>
+
+<h2 id='reviewing_the_course_outline'>Reviewing the Course Outline</h2>
+
+<ul>
+<li>Introducing FlexUnit 4.1</li>
+
+<li>Overview of Testing Terms and Terminology</li>
+
+<li>FlexUnit Capabilities</li>
+
+<li>FlexUnit Basics</li>
+
+<li>Developing Static Tests</li>
+
+<li>Working with the Test Fixture</li>
+
+<li>Using Suites</li>
+
+<li>FlexUnit Theories</li>
+
+<li>External Data</li>
+
+<li>Mock Classes</li>
+
+<li>Parameterized Tests</li>
+
+<li>Running Tests from Different Versions</li>
+
+<li>Working with Asynchronous Operations</li>
+
+<li>UIComponents</li>
+
+<li>Creating Testable Code</li>
+
+<li>Allowing your Tests to Function with Continuous Integration</li>
+</ul>
+			</div>
+		
+			<div id="footnav">
+				<a href="Unit-1.html" class="next"></a>
+				<a href="../flexunit.html" class="firstindexbutton"></a>		
+			</div>
+		</div>
+				
+	</div>
+
+</body>
+</html>
\ No newline at end of file

Added: websites/staging/flex/trunk/content/flexunit/tutorial/flexunit/Unit-1.html
==============================================================================
--- websites/staging/flex/trunk/content/flexunit/tutorial/flexunit/Unit-1.html (added)
+++ websites/staging/flex/trunk/content/flexunit/tutorial/flexunit/Unit-1.html Thu Mar 20 03:56:18 2014
@@ -0,0 +1,259 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+	
+	<title>Introducing FlexUnit 4.1</title>
+
+	<script language="JavaScript" src="../scripts/jquery-1.5.min.js" ></script>
+	<link href="../css/style.css" rel="stylesheet" type="text/css" />
+
+</head>
+<body>
+	
+	<div id="container">
+		
+		<div id="contentborder">
+			<div id="unitdownload">
+				
+					<a href="../code/unit1.zip"><img style="vertical-align:middle;border-style:none;" src="../images/DownloadIcon.png" alt="Download" /></a>
+					<span style="font-size:24px;font-weight:bold;color:#666666;margin-left:10px;">Project Files</span>
+				
+			</div>
+			<div id="content">
+
+<h1>Unit 1 - Introducing FlexUnit 4.1</h1>
+
+<p>FlexUnit 4.1 is an extensible testing framework for ActionScript 3.0 classes and provides extensions for working with the Flex 2, 3, and 4 Framework, and Adobe AIR projects.  The FlexUnit framework is used to automate unit and integration testing.</p>
+
+<h3>Objectives:</h3>
+
+<p>After completing this lesson, you should be able to:</p>
+<ul>
+	<li>Explain why we test automatically</li>
+	<li>Understand FlexUnit .9</li>
+	<li>Understand Fluint 1.x</li>
+	<li>Understand FlexUnit version 4.x</li>
+</ul>
+
+<h3>Topics</h3>
+
+<p>In this unit, you will learn about the following topics:</p>
+<ul>
+	<li>Understanding why we test automatically</li>
+	<li>Understanding FlexUnit .9</li>
+	<li>Understanding Fluint 1.x</li>
+	<li>Understanding FlexUnit 4.x</li>
+	<li>Understanding the integration between Flash Builder and FlexUnit</li>
+	<li>Getting Help</li>
+</ul>
+
+<h2>Understanding why we test automatically</h2>
+
+<p>Automated testing is designed to solve several problems:</p>
+<ul> 
+	<li>We are all fallible.</li>
+	<li>We all get tired, bored and stressed.</li>
+	<li>Projects have limited time available and we must often make hard decisions.</li>
+	<li>We can spend our time developing new code or debugging old code but the majority of us prefer the former.</li>
+	<li>Software errors cost a lot of money and time.</li>
+</ul>
+
+<h3>The background on software and errors</h3>
+
+<p>A 2002 NIST study found that software errors cost the US economy .6% of the US GDP yearly. That sets the net loss today at about 79.8 billion dollars a year.</p>
+<p>Half of that cost is absorbed by people who buy software. The other half is absorbed by people who create software. The same study noted that 80% of development costs are spent on identifying and correcting defects. In other words, less than 20% of development cost goes to planning, initial coding and related activities. The cost of errors is proportionate to when they are found. Any requirements error found after release can cost 10 to 100 times as much to fix as during the requirements gathering phase. An architecture error found after release can cost 25 to 100 times as much to fix this late in the process.</p>
+
+<h3>Testing versus Automated Testing</h3>
+
+<p>Many people believe in testing, however, automating these tests is often looked at as extra work. Here are a few additional things to consider:</p>
+<ul>
+	<li>There are a limited number of hours in a day.</li>
+	<li>Code that hasn't been tested lately is susceptible to failure.</li>
+	<li>As people become tired, they test less effectively.</li>
+	<li>People are affected by emotion.</li>
+	<li>By reducing the defects in their code, developers will have additional time in the project to allow for testing.</li>
+	<li>The earlier we catch a mistake the cheaper it is to fix. To catch errors early, we need to test constantly.</li>
+</ul>
+
+<img alt='Stress-Run-Tests' src='../images/unit1/image1.jpeg' />
+
+<p class='caption'>Figure 1: Influence Diagram from Test-Driven Development by Kent Beck. Addison-Wesley Professional (November 18, 2002)</p>
+<p>This influence diagram does a wonderful job of illustrating the point. As stress on a project increases, the amount of time dedicated to running tests decreases. As the amount of time to run tests decreases, the stress increases.</p>
+
+<img alt='Pressure-Testing-Errors' src='../images/unit1/image2.jpeg' />
+
+<p class='caption'>Figure 2: Influence Diagram from Test-Driven Development by Kent Beck. Addison-Wesley Professional (November 18, 2002)</p>
+<p>As pressure increases, manual testing decreases. As manual testing decreases, errors increase. As errors increase, pressure increases. It's a death-spiral.</p>
+
+<h3>Breaking the Spiral</h3>
+
+<p>To break this spiral, drastic change is needed. We need to have a way to test which is not affected by:</p>
+<ul>
+	<li>Pressure</li>
+	<li>Exhaustion</li>
+	<li>Emotion</li>
+	<li>Boredom</li>
+</ul>
+<p>If we rely upon manual testing of code, then our time allocated to testing must necessarily increase as the project grows if every item is going to be retested. This is the inverse of most projects where time grows shorter as the project continues.</p> 
+<p>Setting up automated testing does require some time from developers. However, a test, once created, can be executed by a machine automatically, virtually and constantly. Once implemented, automated testing does not take additional time away from the development team.</p>
+<p>Computers are good at automated tasks. Developers are good at automating time consuming tasks. Testing is a time consuming task which developers should automate.</p>
+
+<h3>Creating Better Code</h3>
+
+<p>Apart from finding errors more quickly, automated testing has the added benefit of allowing us to sleep better at night. Since code is tested more, there can be less fear of change. We do not need to remember every detail of how or why a piece of code works, because we can rely upon the tests to both test and act as a portion of the documentation for that code.</p>
+<p>This means developers can refactor and change code without fear of breaking some other unknown item. This ability to embrace refactoring allows us to change items that need to be changed and solve problems directly and correctly.</p>
+
+<h2>Understanding FlexUnit .9</h2>
+
+<p>The first unit testing framework created specifically for RIA development was AS2Unit in 2003, developed for the RIA community by Alistair McLeod (then at a company named iteration::two, now at Adobe Consulting). When Flex 1.0 was released the same team released FlexUnit, borne out of AS2Unit and with a graphical test runner for the Flex development environment.</p>
+<p>The release of Flex 2, which introduced ActionScript 3, meant that another migration was required, and a team from Adobe Product Engineering and the Adobe Developer Relations team performed this and released another version, FlexUnit .9, on Adobe Labs. To allow community contributors, the project was thereafter moved to Google Code under the name as3flexunit.</p>
+<p>In August 2008, FlexUnit .9 moved back to Adobe, and now resides on Adobe Open Source.</p>
+<p>FlexUnit .9 was based on a JUnit 3.x model of unit testing. A user could build a series of new tests by extending a core FlexUnit class. These classes could evaluate aspects of a class and report back their results to a graphical runner that showed successes or failures.</p>
+
+<h2>Understanding Fluint 1.x</h2>
+
+<p>In 2005, the popularity of the Flex framework continued to grow, pushed forward by the adoption of this technology by enterprise customers. Many of these customers began to produce their own Flex framework component and extensions which were in dire need of testing.</p>
+<p>Internally, Flex components are almost entirely asynchronous and are not architected in such a way to provide distinct and testable units. While FlexUnit .9 was able to provide a solid base for testing ActionScript classes, it was difficult to test event-based synchronous and asynchronous operations using this framework. The result of these two issues was a large number of untested and untestable Flex components growing inside of client organizations worldwide.</p>
+<p>In 2006, Digital Primates, a Chicago-based Flex consultancy, decided to solve this issue by extending FlexUnit .9 and providing enhanced support for asynchronous operations. Unfortunately, FlexUnit .9 was not open for extension and, at that time, Adobe was not accepting community contributions to the project. After several attempts to modify the existing code, a decision was made to simply create a new testing framework for Flex specifically designed to simplify the integration level operations needed to test UIComponents. The result of this effort was an internal tool named dpUInt (Digital Primates Unit and Integration).</p>
+<p>dpUInt could provide standard unit testing functionality, but it also provided concepts such as sequences and enhanced asynchronous support, allowing a user to wait for multiple asynchronous events and create tests along the lines of:</p>
+<ul>
+	<li>Build a button</li>
+	<li>Add it to the display list</li>
+	<li>Wait for it to finish creating</li>
+	<li>Click that button</li>
+	<li>Wait for it to emit the correct event</li>
+</ul>
+<p>In 2007, Digital Primates decided to open this tool to the world at large under an MIT open source license. The community eagerly engaged with the new tool and began making suggestions and contributions. In September of 2008, the unit testing framework was renamed to Fluint (Flex Unit and Integration) and released as a 1.0 version under the MIT license.</p>
+<p>The project continued to evolve and develop with contributions from both Digital Primates and the community and continues to experience active use today.</p>
+
+<h2>Understanding FlexUnit 4.x</h2>
+
+<p>Towards the end of 2008, Adobe decided that integrating unit testing into their Flash Builder Integrated Development Environment (IDE) was a goal for the next major release. At the time, they had planned to use FlexUnit .9.</p>
+<p>Through a series of discussions, the teams at Digital Primates and Adobe Consulting began planning a new version of FlexUnit which would combine the strengths of the previous version with advances in both the Java and Flex testing communities.</p>
+<p>This new version, named FlexUnit 4, started with the core requirements provided by JUnit 4.5 but was rewritten to support the core needs of the Flash Player. Additionally, the extended functionality of Fluint and other tools was added to create a testing platform. Unlike the original FlexUnit, extensibility was a key goal as well as integration with other systems and platforms.</p>
+<p>FlexUnit 4 was released to alpha in May of 2009 and has continued to update since that time.</p>
+<p>Unlike either of its ancestors, FlexUnit 4.x is based on the concept of metadata (similar to Java annotations) to define tests. This provides a much simpler way to define and build tests.</p>
+<p>FlexUnit 4.x further has the ability to execute FlexUnit .9 and Fluint 1.x style unit tests, making upgrade and compatibility easy.</p>
+
+<h2>Understanding the integration between Flash Builder and FlexUnit</h2>
+
+<p>Adobe Flash Builder 4 Premium ships with FlexUnit 4.0 included. The integration between Flash Builder and FlexUnit consists of several wizards to create test suites and test cases along with a FlexUnit result panel which displays the results of the test run.</p>
+<p>While Flash Builder's wizards can create either FlexUnit .9 or FlexUnit 4 style tests, the FlexUnit 4 framework is used to execute these tests in all cases.</p>
+<p>The FlexUnit framework is an open source project under the MIT license and maintained by the Flex and ActionScript communities. The Flash Builder plugin and related code is maintained exclusively by Adobe.</p>
+<p>The release schedule for these two products is not synchronized and their version numbers are not synchronized. FlexUnit 4.1 is expected to be released in September of 2010 and will work with any version of Flash Builder.</p>
+ 
+<h3>Demo: Running a Unit Test Case</h3>
+
+<p>In this walkthrough you will perform the following tasks:</p>
+<ul>
+	<li>Import the FlexUnit4Training.fxp file into Flash Builder.</li>
+	<li>Run a unit test case.</li>
+</ul>
+ 
+<h3>Steps</h3>
+<ol>
+	<li>
+		<p>Start Flash Builder:</p>
+		<p>In Windows: start by choosing Start &#62; Programs &#62; Adobe &#62; Adobe Flash Builder.</p>
+		<p>In Mac: from Finder, browse to your Applications &#62; Adobe Flash Builder 4 directory. Run from Adobe Flash Builder 4.</p>
+		<p>This is most likely the way you will start Flash Builder. You may already have Eclipse installed on your computer and previously added the Flex functionality using the plug-in configuration. In that case, you need to open Eclipse as you have before, and switch to the Flash perspective.</p>
+	</li>
+	<li>
+		<p>From the main menu of Flash Builder, choose File &#62; Import &#62; Flash Builder Project. Flash Builder has the ability to import pre-existing projects packaged in the FXP format as a stand-alone file.</p>
+		<p>In the Import Flash Builder Project dialog box that opens, click the first Browse button on the right of the screen. Navigate to the FlexUnit 4 Training/FXPs/Unit 1/Start directory on the provided media, and select the FlexUnit4Training.fxp file.</p>
+	</li>
+	<li>	
+		<p>The screen will change to show new Import method options with either "Import new copy of project" or "Overwrite existing project." Choose "Import new copy of project" and extract the project to your Flash Builder workspace, making sure to replace "LocationContainingFXPFile" and "YourFlexWorkplace" with the location of the FXP file on your machine and your preferred directory for Flex projects.</p>
+		
+		<img alt='ImportingANewProject' id='shift' src='../images/unit1/image3.png' />
+		<p class='caption' id='shift'>Figure 1: Importing a new Flex project</p>
+		
+		<p>In future sections, you will select "Overwrite existing project" instead.</p>
+		<p>Once the project has been imported, it should appear in the Package Explorer on the left.</p>
+	</li>
+	
+	<h3><br />Run the application</h3>
+	
+	<li>
+		<p>In the Package Explorer, expand the src folder's default package double-click the SampleCircleLayout.mxml file to open it.</p>
+	</li>
+	<li>
+		<p>Click on the run button's dropdown arrow to reveal the run menu, choose the SampleCircleLayout option.</p>
+		
+		<img alt='runApplicationButton' id='shift' src='../images/unit1/image4.png' />
+		<p class='caption' id='shift'>Figure 2: Running SampleCircleLayout.mxml</p>
+		
+		<p>If the SampleCircleLayout.mxml ran successfully, you should see the following in your browser window:</p>
+		
+		<img alt='sampleCircleLayout' id='shift' src='../images/unit1/image5.png' />
+		<p class='caption' id='shift'>Figure 3: SampleCircleLayout in the browser</p>
+	</li>
+	
+	<h3><br />Run the tests</h3>
+	
+	<li>
+		<p>In the Package Explorer, expand the src folder's default package and double-click the FlexUnit4Training.mxml file to open it. The contents of this file will be explored in more details in a future unit.</p>
+	</li>
+	<li>	
+		<p>Click on the run button's dropdown arrow to reveal the run menu. Choose the FlexUnit Tests option.</p>
+		
+		<img alt='FlexUnitTests' id='shift' src='../images/unit1/image6.png' />
+		<p class='caption' id='shift'>Figure 4: Running FlexUnit Tests in Flash Builder</p>
+	</li>		 
+	<li>
+		<p>In the FlexUnit Results tab in Flash Builder, click on the plus sign at the start of the math.testcases.BasicCircleTest line, this will expand the test file and show each individual test that passed.</p>
+		<p>If the FlexUnit tests ran successfully, you should see the following output in your FlexUnit Results tab:</p>
+		
+		<img alt='TestsPassed' id='shift' src='../images/unit1/image7.png' />
+		<p class='caption' id='shift'>Figure 5: Five FlexUnit Tests passed</p>
+	</li>		
+</ol>	
+ 
+<h2>Getting Help</h2>
+
+<h3>FlexUnit.org</h3>
+
+<p>FlexUnit.org is the site for FlexUnit 4.x. The site includes FlexUnit 4.x news and updates, API Docs, Documentation, Blog, and Download pages. The Download page includes the FlexUnit 4 Turnkey Project, full Flex-Based FlexUnit libraries for Flex 4.0 and 3.5 SDK's, full ActionScript-only libraries for Flex 3.4 and 4.0 SDK's, and the release candidate for FlexUnit 4.1 for Flex 4.0 and 3.5 SDK's.</p>
+<p>The Download page includes links for the FlexUnit project code on GitHub.</p>
+
+<ul>
+	<li><a class='contentlink' href='http://www.flexunit.org' target='_blank'>FlexUnit 4.x Download Page</a></li>
+	<li><a class='contentlink' href='http://docs.flexunit.org/asdocs/index.html' target='_blank'>FlexUnit 4.x API Docs</a></li>	
+	<li><a class='contentlink' href='http://docs.flexunit.org/index.php' target='_blank'>FlexUnit 4.x Documentation</a></li>
+</ul>
+ 
+<h3>Tender</h3>
+
+<p>The Tenderapp aggregates questions and concerns we have seen over years of supporting and developing FlexUnit 4.x, and should find answers sooner than any available forum.</p>
+<p>The Tenderapp includes a KnowledgeBase/FAQ section as well as a Public Discussion section. The FlexUnit 4.x knowledgebase goes in-depth with the common problems that FlexUnit 4.x users and contributors have seen. The Public Discussion section begins a problem discussion, monitored closely by our FlexUnit 4.x support staff. When posting discussion topics within the discussion section, certain recommended articles in the Knowledgebase will be listed based on the needs of the discussion.</p>
+<ul>
+	<li><a class='contentlink' href='http://flexunit.tenderapp.com/' target='_blank'>FlexUnit Support</a></li>
+</ul>
+
+<h2>Summary</h2>
+
+<ul>
+	<li>Testing automatically helps solve many commonly encountered problems in software development, such as human fallibility, project time constraints, and stress.</li>
+	<li>FlexUnit 4.x is an open source unit testing framework for Flex and ActionScript 3.0. It is integrated into the Flash Builder 4 IDE and was built on the strengths of its predecessors, FlexUnit .9 and Fluint.</li>
+	<li>For help and additional information on FlexUnit 4.x:</li>
+	<ul>
+		<li><a class='contentlink' href='http://www.flexunit.org' target='_blank'>http://www.flexunit.org</a></li>
+		<li><a class='contentlink' href='http://flexunit.tenderapp.com' target='_blank'>http://flexunit.tenderapp.com</a></li>
+	</ul>
+</ul>	
+
+			</div>
+		</div>
+		
+		<div id="footnav">
+			<a href="Unit-2.html" class="next"></a>
+			<a href="Introduction.html" class="prev"></a>
+			<a href="../flexunit.html" class="indexbutton"></a>
+		</div>
+				
+	</div>
+	
+
+</body>
+</html>
\ No newline at end of file

Added: websites/staging/flex/trunk/content/flexunit/tutorial/flexunit/Unit-10.html
==============================================================================
--- websites/staging/flex/trunk/content/flexunit/tutorial/flexunit/Unit-10.html (added)
+++ websites/staging/flex/trunk/content/flexunit/tutorial/flexunit/Unit-10.html Thu Mar 20 03:56:18 2014
@@ -0,0 +1,721 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+	
+	<title>Mock Classes</title>
+
+	<script language="JavaScript" src="../scripts/jquery-1.5.min.js" ></script>
+	<link href="../css/style.css" rel="stylesheet" type="text/css" />
+
+</head>
+<body>
+	
+	<div id="container">
+		
+		<div id="contentborder">
+			<div id="unitdownload">
+				
+					<a href="../code/unit10.zip"><img style="vertical-align:middle;border-style:none;" src="../images/DownloadIcon.png" alt="Download" /></a>
+					<span style="font-size:24px;font-weight:bold;color:#666666;margin-left:10px;">Project Files</span>
+				
+			</div>
+			<div id="content">
+
+<h1>Unit 10 - Mock Classes</h1>
+
+<p>In the beginning of this course you learned that unit testing a class requires that it be isolated from other dependencies. In this way, you can test your code free from unnecessary complexity and potentially unknown side effects introduced by other classes.</p>
+<p>Mocking is one technique for isolating your class. It works by providing intelligent substitutes for class dependencies.</p>
+
+<h3>Objectives:</h3>
+
+<p>After completing this lesson, you should be able to:</p>
+<ul>
+	<li>Create test cases using Mock Objects</li>
+	<li>Use the Mockolate Rule to automatically create mocks</li>
+	<li>Add and validate mock functionality with stubbing, spying, and verification</li>
+	<li>Set expectations for mock classes using the Mockolate framework</li>
+</ul>
+
+<h3>Topics</h3>
+
+<p>In this unit, you will learn about the following topics:</p>
+<ul>
+	<li>Understanding the use case for mocks</li>
+	<li>Examining available mocking frameworks</li>
+	<li>Using Rules</li>
+	<li>Working with a mock</li>
+	<li>Using the Mockolate Rule</li>
+	<li>Creating a test with mock objects</li>
+	<li>Individual verifications</li>
+</ul>
+
+<h2>Understanding the use case for mocks</h2>
+
+<p>When unit testing a system, it is essential that its components are tested in isolation.</p>
+<p>Consider this example:</p>
+<ol>
+	<li><p>A Schedule class facilitates the storage of appointments in a database.</p></li>
+	<li><p>The scheduleAppointment, cancelAppointment, and modifyAppointment methods of the Schedule class need to be tested.</p></li>
+	<li><p>As you might imagine, each of these methods takes several parameters and each has several different outcomes requiring many tests.</p></li>
+	<li><p>In production, the Schedule class interacts with services that make connections to a remote database to retrieve and store schedule information.</p></li> 
+</ol>
+<p>Consider the possible dependencies involved in the Schedule class in the system. First, the class interacts with services in some way, making the services a dependency. The services connect to a database, likely through an application server. The request is sent over the network, meaning that the network card, protocol stack and physical connections are all involved.</p>
+<p>There are a huge number of problems with testing this system. If a failure occurs in any of the layers mentioned above, the tests for your Schedule Class will fail. Given that situation, how can you possibly determine the cause of the failure?</p>
+<p>Additionally, tests written against an entire system like this can take significant time to retrieve data or produce a failure. This extra time discourages you from running the test frequently.</p>
+<p>If you attempt to test the entire system, then you are not testing the Schedule class in isolation and it is therefore not a unit test.</p>
+<p>You could try to solve this issue in a number of ways. You could create test versions of the database, but this adds extra effort and maintenance to objects that have nothing to do with the class functionality. You could create your application to return fake or stub data in specific circumstances, but this again causes extra maintenance and means that you are testing your system in a slightly different way than it is deployed.</p>
+<p>Test substitutes can be used to solve these problems. Test substitutes are essentially fake versions of objects used for testing. In this case, if code is well architected, you can provide a test substitute for the services used by the Schedule class. These substitutes generally come in two flavors: Fake objects and Mock objects.</p> 
+<p>Fake objects are object shells that have very little functionality of their own. They may have no functionality, or only functionality that can be verified by simple visual inspection. This lack of functionality means that the Fake object is not suspect when a test failure occurs, thus refocusing the tests back to the Schedule class itself.</p>
+<p>The second type of substitute object used is a Mock object. Mocks are similar to Fake objects; however, they are more intelligent and complex internally. Mock objects allow you to set expectations and verify those expectations.</p>
+<p>In other words, you could provide a service layer Mock to the Schedule class and indicate that the Mock should expect to see its <code>callTheServer()</code> method called and passed a particular schedule entry.</p>
+<p>Mocks are extremely useful and can once again increase the legibility of your test cases. As Mocks are not verifiable via simple visual inspection, they are often built upon a mocking framework that provides the base mock functionality and a suite of tests to prove it works correctly. This again lets you focus on the Schedule class instead of testing all of its external dependencies.</p>
+
+<h2>Examining available Mocking frameworks</h2>
+
+<p>There are many mocking frameworks available to the ActionScript community. This list should not be considered an exhaustive list, but these are among the more popular at the time of writing.</p>
+<ul>
+	<li>asmock</li>
+	<ul>
+		<li>Provides a specialized runner for FlexUnit 4</li>
+		<li>Creates mock versions of a class's public interface</li>
+		<li>Allows creation of required and optional results</li>
+	</ul>
+	<li>mock-as3</li>
+	<ul>
+		<li>Older mocking framework that required the creation of static classes that act as mocks.</li>
+		<li>The author of mock-as3 has released a newer framework named Mockolate which will be used in this unit.</li>
+	</ul>
+	<li>mock4as</li>
+	<ul>
+		<li>Minimalistic framework</li>
+		<li>Can use subclassing or composition</li>
+		<li>With effort, can return very detailed customized results</li>
+		<li>mockito-flexTest spy framework that works with FlexUnit 4.x</li>
+		<li>Extension of asmock</li>
+	</ul>
+	<li>mockolate</li>
+	<ul>
+		<li>Uses a custom FlexUnit Rule to institute mock behavior</li>
+		<li>Can be run alongside other custom runners</li>
+		<li>Allows creation of strict or nice mocks</li>
+		<ul>
+			<li>Nice mocks do not require expectations on all behavior allowing testing of only specific functionality.</li>
+			<li>Strict mocks require expectations on all behavior.</li>
+		</ul>
+	</ul>
+</ul>
+<p>In this course you will use Mockolate. The developers of Mockolate are active contributors to the FlexUnit project.</p>
+
+<h2>Working with a mock</h2>
+
+<p>Mocks set up a special form of a substitute object which records all method calls and property access of the mock. Each time a method on the mock is called, the arguments supplied are recorded.</p> 
+<p>Mocks can also be configured to return known values based on given input. In other words, a mock could be told to return true each time a given method is called providing the minimal necessary logic to test your class.</p>
+<p>Setting up a mock requires understanding the expected interaction between the object under test and the mocked dependency as you are simulating the behavior of the real object.</p> 
+<p>Unfortunately, the close knit behavior of the mock object and the real object it is mocking does create some additional maintenance on the test system. Failure to maintain the mock conditions can create false positives or false negatives.</p> 
+<p>To use a mock, you must first create an instance of the mock object. Once the object is created, you must inject the mock in place of the real object. Effectively, mocks make use of the object oriented concept of polymorphism to ensure that the system under test will not notice any difference between the real and mock object. The mock object will then begin recording any access including method calls, arguments and property access.</p>
+<p>The syntax for creating and using a mock depends on the mocking framework used. For this course you will use Mockolate. Mockolate may be used in two ways: either by setting expectations and verifying the expectations were met or by using test spies to replay the calls on a mocked object and verify its expected behavior.</p>
+<p>Mock objects can:</p>
+<ul>
+	<li>Return a value or sequence of values</li>
+	<li>Dispatch events</li>
+	<li>Call other functions</li>
+	<li>Throw Errors</li>
+</ul>
+
+<h2>Using Rules</h2>
+
+<p>Rules are objects that implement a specific interface to allow developer extension of the main test runner provided with FlexUnit 4. Using rules, a developer may create reusable test fixtures, evaluate a test differently or add steps into the test evaluation process. You will examine rules in more detail later; however, they are being briefly introduced at this time as the primary way of using Mockolate is through a Rule.</p>
+<p>To use a rule, instantiate a public property in a test case, and decorate the property with the [Rule] metadata:</p>
+
+<code><pre>[Rule]
+public var myRuleThatDoesSomethingCool:MyRule = new MyRule();</pre></code>
+
+<h2>Using the MockolateRule</h2>
+<p>Included in the Mockolate library is a rule named MockolateRule. It is specifically for use with FlexUnit 4. The Mockolate rule saves many manual steps required to create mocks.</p>
+<p>Different mocking frameworks work in different ways. Mockolate works by creating compiled ActionScript code for the required mock object in memory at runtime. This is an extremely effective and useful technique; however, Flash Player does not allow this operation to occur synchronously. Therefore, setting up a Mockolate mock is an asynchronous process. The Mockolate rule manages these details without your intervention.</p>
+<p>To use the rule, include the following:</p>
+
+<code><pre>[Rule]
+public var mockRule:MockolateRule = new MockolateRule();</pre></code>
+
+<p>Once the rule is included, you may use a special piece of metadata named [Mock] to create and inject Mockolate mocks.  You will do this in the following walkthrough.</p>
+
+<h2>Walkthrough 1: Adding a Simple Mockolate Rule</h2>
+
+<p>In this walkthrough you will perform the following tasks:</p>
+<ul>
+	<li>Change the Circle class to handle default mock creation.</li>
+	<li>Create a new test case to handle mocks.</li>
+	<li>Establish a MockolateRule to instantiate mock objects for testing.</li>
+</ul>
+
+<h3>Steps</h3>
+
+<ol>
+	<li>
+		<p>Import the FlexUnit4Training_wt1.fxp project from the Unit 10/Start folder. If you completed the previous walkthrough, choose the option to overwrite your existing project. If this is your first walkthrough, import it as a new project.  Please refer to Unit 2: Walkthrough 1 for instructions on importing a Flash Builder project.</p>
+		<p>The new FlexUnit4Training project contains everything that all the walkthroughs up until this point have accomplished. Additionally, it includes several new files and additional dependencies to help you through the current walkthrough.</p>
+
+		<h3><br />Changing the Circle class</h3>
+		
+	</li>
+	<li>
+		<p>Open the Circle.as file in the src directory in the package net.digitalprimates.math.</p>
+	</li>
+	<li>
+		<p>Take a look at the constructor for the class:</p>
+		<code><pre>public function Circle( origin:Point, radius:Number )</pre></code>
+		<p>Currently, the constructor takes two arguments, a <code>Point</code> and a <code>Number</code>. In this walkthrough, you will be mocking this object. Mock automatically passes default parameters for all arguments. This means origin will be <code>null</code> and the radius will be <code>0</code>. A circle cannot have a <code>null</code> origin or a radius of <code>0</code>, you will need to handle these cases. Later, you will be shown how to pass actual values to the mock.</p>
+	</li>
+	<li>
+		<p>Comment out the range check for radius.</p>
+		
+		<code><pre>
+// if( ( radius &#60;= 0 || isNaN( radius ) ) {
+//	throw new RangeError( "Radius must be a positive Number" );
+// }</pre></code>
+		
+		<p>You are commenting this out for simplicity. The default radius of 0 will cause the range error to be thrown. This will prevent that from happening.</p>
+	</li>
+	<li>
+		<p>Immediately after the range check for radius, add a null check for origin. If origin is null, instantiate to a new <code>Point</code> with x and y of 0.</p>
+
+		<code><pre>if( origin == null ) {
+	origin = new Point( 0, 0 );
+}</pre></code>
+		
+		<p>Your <code>Circle</code> constructor should now appear as follows:</p>
+
+		<code><pre>public function Circle( origin:Point, radius:Number ) {
+	// if( ( radius &#60;= 0 || isNaN( radius ) ) {
+	// 	throw new RangeError( "Radius must be a positive Number" );
+	// }
+
+	if( origin == null ) {
+		origin = new Point( 0, 0 );
+	}
+
+	this._origin = origin;
+	this._radius = radius;
+}</pre></code>
+		
+		<h3><br />Declare the MockolateRule</h3>
+	</li>
+	<li>
+		<p>Create a new ActionScript class named CircleMockTest in the math.testcases package within the tests directory.</p>
+	</li>
+	<li>
+		<p>Remove the automatically created constructor from the test class.</p>
+	</li>
+	<li>
+		<p>Add and instantiate a public variable named <code>mockRule</code> of type <code>MockolateRule</code> to the CircleMockTest class. Mark the variable with <code>[Rule]</code> metadata.</p>
+
+		<code><pre>[Rule]
+public var mockRule:MockolateRule = new MockolateRule();</pre></code>
+		
+		<p>If you did not use code-completion, add the import for mockolate.runner.MockolateRule at this time.</p>
+	</li>
+	<li>
+		<p>Add a variable named <code>mockCircle</code> of type <code>Circle</code> to the class. Mark the variable with <code>[Mock]</code> metadata.</p>
+
+		<code><pre>
+[Mock]
+public var mockCircle:Circle;</pre></code>
+
+		<p><code>[Mock]</code> metadata marks a variable for mock creation and injection. Mock creation is the equivalent of object instantiation within the Mockolate framework. Variables marked with this metadata are prepared for use as Mocks. By using the MockolateRule, this mock will be instantiated with default values prior to any tests being run in the test case.</p>
+		<p>If you did not use code-completion, add the import for net.digitalprimates.math.Circle at this time.</p>
+	</li>
+	<li>
+		<p>Add a method named <code>shouldBeNotNull()</code>. It will assert that the <code>mockCircle</code> is not null.</p>
+
+		<code><pre>[Test]
+public function shouldBeNotNull():void {
+	assertThat(mockCircle, notNullValue() );
+}</pre></code>
+		
+		<p>If you did not use code-completion, add the import statements for org.flexunit.assertThat and org.hamcrest.object.notNullValue at this time.</p>
+	</li>
+	<li>
+		<p>Save CircleMockTest.as.</p>
+
+		<h3><br />Add the CircleMockTest to the CircleSuite</h3>
+		
+	</li>
+	<li>
+		<p>Open the CircleSuite.as file within the math.testcases package. Add a new public variable named <code>test4</code> with a type of <code>CircleMockTest</code></p>
+
+		<code><pre>[Suite]
+[RunWith("org.flexunit.runners.Suite")]
+public class CircleSuite {
+	public var test1:BasicCircleTest;
+	public var test2:CircleConstructorTest;
+	public var test3:CircleTheory;
+	public var test4:CircleMockTest;
+}</pre></code>
+		
+	</li>
+	<li>
+		<p>Save the CircleSuite.as file.</p>
+	</li>
+	<li>
+		<p>Run the FlexUnit4Training.mxml file.</p>
+		<p>If FlexUnit4Training.mxml ran successfully you should see the following output in your browser window:</p>
+
+		<img alt='TestsPassed' id='shift' src='../images/unit10/image1.png' /> 
+		<p class='caption' id='shift'>Figure 1: FlexUnit tests passed</p>
+
+		<p>Notice the failure. This is because you commented out the range check in Circle. The CircleConstructorTest is expecting this error to be thrown. This is an unfortunate side effect of changing the Circle class. This will be corrected when you inject the mock later.</p>
+	</li>
+</ol>
+
+<h2>Creating a test with mock objects</h2>
+
+<p>Mockolate has logic for two types of mocks: nice and strict.</p>
+<ul>
+	<li>Nice Mocks only require methods and properties with expectations to be stubbed or mocked. Other methods or properties in the mock object will return fake or generic values that will not throw errors, necessarily.</li> 
+	<li>Strict Mocks throw an InvocationError for any method called that is not mocked or stubbed. In other words, the complete functionality of the mock has to be mocked or stubbed in order to test with the mock.</li>
+</ul>
+<p>By default, Mockolate creates nice, injected mocks.</p>
+<p>To create a mock, create the variable as normal and decorate it with the [Mock] metadata.</p>
+
+<code><pre>[Mock]
+public var myMock:MockableObject;</pre></code>
+
+<p>The [Mock] metadata accepts two possible arguments: <code>type</code> and <code>inject</code></p>
+<ul>
+	<li>type - <code>strict</code> or <code>nice</code></li>
+	<li>inject - <code>true</code> or <code>false</code> - If set to false, will prepare (create the ActionScript byte code) the mock but not create it. The mock will need to be instantiated before it is used.  Non-injected mocks are generally only used when the mocked object's constructor has parameters.</li>
+</ul>
+<p>By default, Mockolate creates a nice, injected mock.</p>
+<p>A strict, non-injected mock would appear as:</p>
+
+<code><pre>[Mock(type="strict",inject="false")]
+public var myMock:MockableObject;</pre></code>
+
+<p>Once the mock is created, it can be used in tests.  To use the mock you must <i>stub</i> or <i>mock</i> all methods or properties under test.</p>
+<ul>
+	<li>stub - specifies optional behaviors or expectations</li>
+	<li>mock - specifies required behaviors or expectations</li>
+</ul>
+<p>Stubbing or mocking is used to define the behavior of the object.  Without stubbing or mocking a method or property will return values of null, false, or some other probably useless value.</p>  
+<p>A method or property can be stubbed to:</p>
+<ul>
+	<li>Return a getter</li>
+	<code><pre>stub(myMock).getter("name").returns("Useful Mock");</pre></code>
+</ul>
+<ul>
+	<li>A method without arguments</li>
+	<code><pre>stub(myMock).method("toString").returns("Useful Mock");</pre></code>
+</ul>
+<ul>
+	<li>With args</li>
+	<code><pre>stub(myMock).method("add").args(3, 5).returns(8);</pre></code>
+</ul>
+<ul>
+	<li>With Hamcrest</li>
+	<code><pre>stub(myMock).method("repeatIt").args(instanceOf(String)).returns(instanceOf(String));</pre></code>
+</ul>
+<p>This list is not exhaustive.  If the real object can do it, the mock can likely simulate the behavior.  All of these approaches can be used with mocks as well to set required behaviors.</p>
+<p>Mocks are used to stand-in as complex objects for a given class or methods under test. Furthermore, they are used to isolate the system under test, so extraneous dependencies are not interfering with test execution or expectations.</p>
+
+<h2>Walkthrough 2: Setting Expectations</h2>
+
+<p>In this walkthrough you will perform the following tasks:</p>
+<ul>
+	<li>Create a nice mock expectation.</li>
+	<li>Create a strict mock expectation.</li>
+</ul>
+
+<h3>Setting nice mock expectations</h3>
+
+<ol>
+	<li>
+		<p>Open the CircleMockTest.as file from the previous walkthrough.</p>
+		<p>Alternatively, if you didn't complete the previous lesson or your code is not functioning properly, you can import the FlexUnit4Training_wt2.fxp project from the Unit 10/Start folder. Please refer to Unit 2: Walkthrough 1 for instructions on importing a Flash Builder project.</p>
+	</li>
+	<li>
+		<p>Add a new method <code>shouldBeEqualCircleMock()</code> decorated with the test metadata.</p>
+
+		<code><pre>[Test]
+public function shouldBeEqualCircleMock():void {
+}</pre></code>
+
+	</li>
+	<li>
+		<p>Set an expectation that the <code>origin</code> getter will be called at least once. To set an expectation, you use the <code>mock()</code> method of the <code>MockolateRule</code>. You will also need to use the <code>getter()</code> method.</p>
+
+		<code><pre>mock( mockCircle ).getter( "origin" ).atLeast( 1 );</pre></code>
+		
+		<p>If you did not use code-completion, import mockolate.mock at this time.</p>
+	</li>
+	<li>
+		<p>Save the CircleMockTest.as file.</p>
+	</li>
+	<li>
+		<p>Run the FlexUnit4Training.mxml file.</p>
+		<p>If FlexUnit4Training.mxml ran successfully you should see the following output in your browser window:</p>
+
+		<img alt='TestsPassed' id='shift' src='../images/unit10/image2.png' /> 
+		<p class='caption' id='shift'>Figure 1: FlexUnit tests passed</p>
+
+		<p>You will notice an error. This is because the mock expects the origin getter would be called at least once. However, no call was ever made to the getter. You will need to add this call.</p>
+		<p>If you had made this call as a stub rather than a mock, this expectation would have been optional and thus fulfilled.</p>
+		
+		<h3><br />Fulfilling the expectation</h3>
+		
+		<p>You need to fulfill the expectation. You could make the call directly to origin, but this would defeat the purpose of creating the mock. Mocks require some internal workings of how an object operates. Inside the Circle class is a method called <code>equals()</code>. Equals checks if two circles have the same origin and radius.</p>
+	</li>
+	<li>
+		<p>In <code>shouldBeEqualCircleMock()</code>, but after the mock expectation, create a new <code>Circle</code> called <code>circle</code>. As arguments, pass a new origin at <code>Point( 0, 0 )</code> and a radius of <code>0</code>.</p>
+		
+		<code><pre>var circle:Circle = new Circle( new Point( 0, 0 ), 0 );</pre></code>
+		
+		<p>You are passing this circle because the default mock created an origin at 0, 0 with a radius of 0.</p>
+		<p>If you did not use code-completion, add the import for flash.geom.Point.</p>
+	</li>
+	<li>
+		<p>In <code>shouldBeEqualCircleMock()</code>, after the circle is instantiated, make a call to the <code>equals()</code> method of circle. Pass it the <code>mockCircle</code> as a parameter.</p>
+		
+		<code><pre>circle.equals( mockCircle );</pre></code>
+		
+	</li>
+	<li>
+		<p>Save the CircleMockTest.as file.</p>
+	</li>
+	<li>
+		<p>Run the FlexUnit4Training.mxml file.</p>
+
+ 		<img alt='TestsPassed' id='shift' src='../images/unit10/image4.png' />
+		<p class='caption' id='shift'>Figure 2: FlexUnit tests passed</p>
+		
+		<p>The expectation has now been fulfilled and the test is now passing. Next you will attempt to use a strict mock.</p>
+		
+		<h3><br />Using a strict mock</h3>
+		
+	</li>
+	<li>
+		<p>Add the <code>type="strict"</code> annotation to the Mock metadata of <code>mockCircle</code>.</p>
+		<code><pre>[Mock( type="strict" )]</pre></code>		
+	</li>
+	<li>
+		<p>Save the CircleMockTest.as file.</p>
+	</li>
+	<li>
+		<p>Run the FlexUnit4Training.mxml file.</p>
+
+		<img alt='TestsPassed' id='shift' src='../images/unit10/image2.png' /> 
+		<p class='caption' id='shift'>Figure 3: FlexUnit tests passed</p>
+		
+		<p>You will notice another error. Changing the mock to a strict mock requires you to set expectations on all methods and properties that are called as part of the method call.</p>
+		<p>If you look at the stack trace you will be able to see the error.</p>
+
+		<img alt='StackTrace' id='shift' src='../images/unit10/image5.png' />
+		<p class='caption' id='shift'>Figure 4: Stack Trace</p>
+		
+		<p>This error was thrown because no expectation was set for a getter named <code>radius</code>. You will need to add this expectation.</p>
+	</li>
+	<li>
+		<p>At the top of the <code>shouldBeEqualCircleMock()</code>, add the expectation for <code>radius</code> to be called at least once.</p>
+		<code><pre>mock( mockCircle ).getter( "radius" ).atLeast( 1 );</pre></code>		
+	</li>
+	<li>
+		<p>Save the CircleMockTest.as file.</p>
+	</li>
+	<li>
+		<p>Run the FlexUnit4Training.mxml file.</p>
+
+		<img alt='TestsPassed' id='shift' src='../images/unit10/image4.png' /> 
+		<p class='caption' id='shift'>Figure 5: FlexUnit tests passed</p>
+	</li>
+</ol>
+
+<h2>Individual Verifications</h2>
+
+<p>You may have noticed a problem with verifying a strict mock's behavior. In a strict mock, all properties and methods need to have an expectation set. If a method is called or a property accessed without an expectation the mock will throw an error. Frequently, this will force you to set expectations outside of the scope of the test, and, while this will produce a correct result it may create unnecessary overhead in test production. This also ties the test to a specific implementation of the mocked object; if the object implementation changes but the result of the test remains the same this test will need to be refactored.</p>
+<p>In this case, you may use a nice mock. A nice mock is friendly and places none of the requirements on mocking or stubbing every called method. In fact, it will accept any calls placed on it and simply record the behavior. Nice mocks can be tested by setting expectations and verifying results.</p>
+
+<h2>Injecting a Mock Manually</h2>
+
+<p>When injected automatically, mocks pass default parameters to any constructor args, 0 for Number, the empty string for Strings, and null for most other objects. In order to set these constructor arguments to anything else you need to inject the mock manually. Mockolate has a special [Mock] annotation called <code>inject</code> that may be applied to modify mock creation. <code>Inject</code> has two values: <code>true</code> or <code>false</code>. A non-injected mock would appear as:</p>
+
+<code><pre>[Mock( inject="false" )]
+public var mockPoint:Point;</pre></code>
+
+<p>There are two methods to inject a mock, depending on the type, <code>nice()</code> or <code>strict()</code>. The method used must match the mock or an error will be thrown. Both of these take three parameters: the mock, an optional name and optional arguments. Arguments must be specified as an ordered array.</p>
+<p>For Point:</p>
+
+<code><pre>mockPoint = nice( Point, "myPoint", [ 0, 0 ] );</pre></code>
+
+<h2>Walkthrough 3: Injecting mocks</h2>
+
+<p>In this walkthrough you will perform the following tasks:</p>
+<ul>
+	<li>Inject a mock with parameters.</li>
+	<li>Set a getter to return a value.</li>
+	<li>Revert the changes made to the <code>Circle</code> class in Walkthrough 1.</li>
+</ul>
+
+<h3>Steps</h3>
+
+<ol>
+	<li>
+		<p>Open the CircleMockTest.as file from the previous walkthrough.</p>
+		<p>Alternatively, if you didn't complete the previous lesson or your code is not functioning properly, you can import the FlexUnit4Training_wt3.fxp project from the Unit 10/ Start folder. Please refer to Unit 2: Walkthrough 1 for instructions on importing a Flash Builder project.</p>
+
+		<h3><br />Injecting a mock manually</h3>
+		
+	</li>
+	<li>
+		<p>Modify the current mock <code>Circle</code> to create the mock but not inject. To do so, add the inject annotation to the Mock metadata decorating the <code>mockCircle</code> variable.</p>
+		<p>Replace:</p>
+		
+		<code><pre>[Mock( type="strict" )]
+Public var mockCircle:Circle;</pre></code>
+		
+		<p>With</p>
+
+		<code><pre>[Mock( inject="false", type="strict" )
+Public var mockCircle:Circle;</pre></code>
+		
+	</li>
+	<li>
+		<p>Create a new method named <code>setup()</code> decorated with the Before metadata.</p>
+
+		<code><pre>[Before]
+public function setup():void {
+}</pre></code>
+
+	</li>
+	<li>
+		<p>In the before method, inject a strict mock using the <code>strict()</code> method. Pass this method the <code>Circle</code> class, "<code>mockCircle</code>", and the array <code>[ new Point( 0, 0 ), 1  ]</code>. Assign the return for <code>strict()</code> to the <code>mockCircle</code> instance.</p>
+
+		<code><pre>[Before]
+public function setup():void {
+mockCircle = strict( Circle, "mockCircle", [ new Point( 0, 0 ), 1 ] );
+}</pre></code>
+		
+		<p>Since the constructor arguments are now being passed, the range test in the <code>Circle</code> constructor is now satisfied. However, the getters will still return default values. Mocks do not use any of the instance properties. You will need to mock the getters for <code>radius</code> and <code>origin</code> to return values.</p>
+		<p>If you did not use code-completion, add the import for mockolate.strict.</p>
+	</li>
+	<li>
+		<p>Replace the lines:</p>
+		
+		<code><pre>mock( mockCircle ).getter( "origin" ).atLeast( 1 );
+mock( mockCircle ).getter( "radius" ).atLeast( 1 );</pre></code>
+		
+		<p>with</p>
+
+		<code><pre>mock( mockCircle ).getter( "origin" ).returns( new Point( 0, 0 ) ).atLeast( 1 );
+mock( mockCircle ).getter( "radius" ).returns( 1 ).atLeast( 1 );</pre></code>
+
+		<p>This will force the getter and setter to return the required values.</p>
+		<p>If you were to run the test now, it would pass with no errors. However, this does not fulfill the test "shouldBeEqualCircleMock"</p>
+	</li>
+	<li>
+		<p>Change the radius of the circle you instantiate, from a value of 0, to a value of 1.</p>
+		
+		<code><pre>var circle:Circle = new Circle( new Point( 0, 0 ), 1 );</pre></code>
+		
+		<p>We want to compare that this circle is equal to our mock circle, so they should both have the same radius.</p>
+	</li>
+	<li>
+		<p>Replace the line:</p>
+		
+		<code><pre>circle.equals( mockCircle );</pre></code>
+		
+		<p>With</p>
+		
+		<code><pre>assertTrue( circle.equals( mockCircle ) );</pre></code>
+		
+		<p>If you did not use code-completion, add the import for org.flexUnit.asserts.assertTrue</p>
+		
+		<h3><br />Revert the changes to the Circle class.</h3>
+		
+	</li>
+	<li>
+		<p>Open the net.digitalprimates.math.Circle.as file in the src directory.</p>
+		<p>In Walkthrough 1, you modified the <code>Circle</code> class to accept invalid parameters so that you could use mocks. You will now need to revert these changes.</p>
+	</li>
+	<li>
+		<p>Uncomment the following section:</p>
+
+		<code><pre>
+// if ( ( radius &#60;= 0 ) || isNaN( radius ) ) {
+//	throw new RangeError("Radius must be a positive Number");
+// }</pre></code>
+
+	</li>
+	<li>
+		<p>Remove the origin null check. This section is no longer required.</p>
+		<p>Remove:</p>
+
+		<code><pre>if( origin == null ) {
+	origin = new Point( 0, 0 );
+}</pre></code>
+		
+	</li>
+	<li>
+		<p>Save the Circle.as file.</p>
+	</li>
+	<li>
+		<p>Run the FlexUnit4Training.mxml file.</p>
+
+		<img alt='TestsPassed' id='shift' src='../images/unit10/image6.png' />
+		<p class='caption' id='shift'>Figure 1: FlexUnit tests passed</p>
+		
+		<p>The mock is now acting as a stand in of a Circle, accepting parameters and returning the values you have requested. In this way, any object can be mocked to operate exactly as expected, or to test that the expected behaviors are called on the object. In the next walkthrough, you will learn how to mock methods to accept parameters and return values.</p>	
+	</li>
+</ol>
+
+<h2>Walkthrough 4: Method Mocking</h2>
+
+<p>In this walkthrough you will perform the following tasks:</p>
+<ul>
+	<li>Mock the <code>Point</code> class.</li>
+	<li>Mock the <code>add()</code> method of the <code>Point</code> class.</li>
+</ul>
+
+<h3>Steps</h3>
+
+<ol>
+	<li>
+		<p>Create a new ActionScript class named DistanceTest in the math.testcases package within the tests directory.</p>
+		<p>Alternatively, if you didn't complete the previous lesson or your code is not functioning properly, you can import the FlexUnit4Training_wt4.fxp project from the Unit 10/ Start folder. Please refer to Unit 2: Walkthrough 1 for instructions on importing a Flash Builder project.</p>
+
+		<h3><br />Create the test fixture</h3>
+		
+	</li>
+	<li>
+		<p>Remove the automatically created constructor from the test class.</p>
+	</li>
+	<li>
+		<p>Create a private static constant named <code>TOLERANCE</code> as a <code>Number</code>, with a value of <code>.01</code>.</p>
+		<code><pre>private static const TOLERANCE:Number = .01;</pre></code>
+	</li>
+	<li>
+		<p>Add and instantiate a public variable named <code>mockRule</code> of type <code>MockolateRule</code> to the <code>LayoutTest</code> class. Mark the variable with <code>[Rule]</code> metadata.</p>
+
+		<code><pre>[Rule]
+public var mockRule:MockolateRule = new MockolateRule();</pre></code>
+		
+		<p>If you did not use code-completion, add the import for mockolate.runner.MockolateRule at this time.</p>
+	</li>
+	<li>
+		<p>Add a variable named <code>mockPoint</code> of type <code>Point</code> to the class. Mark the variable with <code>[Mock]</code> metadata.</p>
+
+		<code><pre>[Mock]
+public var mockPoint:Point;</pre></code>
+
+		<p>If you did not use code completion, add the import for flash.geom.Point at this time.</p>
+
+		<h3><br />Mocking a method</h3>
+		
+	</li>
+	<li>
+		<p>Create a new test method named <code>shouldBeEqualDistance()</code>. Decorate it with <code>[Test]</code> metadata.</p>
+
+		<code><pre>[Test]
+public function shouldBeEqualDistance():void {
+}</pre></code>
+		
+	</li>
+	<li>
+		<p>Create a new <code>Point</code> called <code>testPoint</code> with x and y values of 5 and 5, respectively.</p>
+		
+		<code><pre>var testPoint:Point = new Point( 5, 5 );</pre></code>
+		
+	</li>
+	<li>
+		<p>Create a new <code>Point</code> called <code>endPoint</code> with x and y values of 10 and 10, respectively.</p>
+		
+		<code><pre>var endPoint:Point = new Point( 10, 10 );</pre></code>
+		
+	</li>
+	<li>
+		<p>Create one last <code>Point</code> called <code>summedPoints</code>. Do not instantiate it at this time.</p>
+		
+		<code><pre>var summedPoints:Point;</pre></code>
+				
+	</li>
+	<li>
+		<p>Add an expectation for the <code>add()</code> method of <code>mockPoint</code> to take an argument, <code>testPoint</code>, and return a new <code>Point</code> with x and y values of 10 and 10.</p>
+		
+		<code><pre>mock( mockPoint ).method( "add" ).args( testPoint ).returns( new Point( 10, 10 ) );</pre></code>
+		
+		<p>The mock will now expect the <code>add()</code> method of <code>mockPoint</code> to be called with the <code>testPoint</code> parameter. When it does, it will return a <code>Point</code> with x and y values of 10 and 10.</p>
+	</li>
+	<li>
+		<p>Make a call to <code>mockPoint.add()</code> passing it the parameter <code>testPoint</code> and assigning the return to <code>summedPoints</code>.</p>
+		
+		<code><pre>summedPoints = mockPoint.add( testPoint );</pre></code>
+		
+	</li>
+	<li>
+		<p>Add a call to <code>assertThat()</code> passing it the parameters <code>endPoint</code> and a new <code>CloseToPointMather</code> with parameters <code>summedPoints</code> and <code>TOLERANCE</code>.</p>
+		
+		<code><pre>assertThat( endPoint, new CloseToPointMatcher( summedPoints, TOLERANCE ) );</pre></code>
+		
+		<p>If you did not use code completion, add the imports for org.flexunit.assertThat and matcher.CloseToPointMatcher at this time.</p>
+	</li>
+	<li>
+		<p>Save the DistanceTest.as file.</p>
+
+		<h3><br />Add DistanceTest to the test suite</h3>
+		
+	</li>
+	<li>
+		<p>Open the CircleSuite.as file within the math.testcases package. Add a new public variable named <code>test5</code> with a type of <code>DistanceTest</code></p>
+
+		<code><pre>[Suite]
+[RunWith("org.flexunit.runners.Suite")]
+public class CircleSuite {
+	public var test1:BasicCircleTest;
+	public var test2:CircleConstructorTest;
+	public var test3:CircleTheory;
+	public var test4:CircleMockTest;
+	public var test5:DistanceTest;
+}</pre></code>
+		
+	</li>
+	<li>
+		<p>Save the CircleSuite.as file.</p>
+	</li>
+	<li>
+		<p>Run the FlexUnit4Training.mxml file.</p>
+
+		<img alt='TestsPassed' id='shift' src='../images/unit10/image7.png' />
+		<p class='caption' id='shift'>Figure 1: FlexUnit tests passed</p>
+	</li>
+</ol>
+
+<h2>Summary</h2>
+
+<ul>
+	<li><p>Mocks are created and plugged in to test cases to further isolate test cases and classes validating their functionality with minimal external dependency.</p></li>
+	<li><p>The mocking framework that this course uses is Mockolate. Mockolate features:</p></li>
+	<ul>
+		<li><p>Nice mocks</p></li>
+		<li><p>Strict mocks</p></li>
+		<li><p>Mocks instantiated with a custom FlexUnit rule</p></li>
+		<li><p>Can be run alongside other FlexUnit custom runners</p></li>
+	</ul>
+	<li><p>When a MockolateRule is used, mocks are instantiated as <code>nice</code> by default.</p></li>
+	<li><p>Setting expectations for <code>strict</code> mocks requires an expectation for every method that will be run.</p></li>
+	<li><p>Expectations can be verified individually on nice mocks, which allows for greater specificity.</p></li>
+</ul>
+
+			</div>
+		</div>
+		
+		<div id="footnav">
+			<a href="Unit-11.html" class="next"></a>
+			<a href="Unit-9.html" class="prev"></a>
+			<a href="../flexunit.html" class="indexbutton"></a>
+		</div>
+				
+	</div>
+	
+
+</body>
+</html>
\ No newline at end of file



Mime
View raw message