From: Choy R. <ch...@us...> - 2005-02-26 19:41:32
|
Update of /cvsroot/dotnetmock/dotnetmock/doc/reference/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3919/doc/reference/src Modified Files: dynamic.xml index.xml start.xml Log Message: Some updates to the docs. Index: start.xml =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/doc/reference/src/start.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** start.xml 13 Feb 2005 10:49:49 -0000 1.1 --- start.xml 26 Feb 2005 19:41:20 -0000 1.2 *************** *** 1,20 **** <chapter id="start"> <title>Getting Started</title> - <section id="start-install"> - <title>Installation</title> - <para> - Installation is simple. Just download the release zip and unzip into - the directory of your choice. If you have InfoZip, the command could - look something like: - <screen>c:\temp> unzip DotNetMock-0.7.4.zip -d c:\sw\dotnet\dotnetmock-0.7.4</screen> - Afterwards, you could register the assemblies with the GAC. - </para> - </section> - <section id="start-using"> - <title>Using DotNetMock in Your Projects</title> - <para> - To use <classname>DynamicMock</classname>s or create your own custom mocks, you only need to add a reference to <literal>DotNetMock.dll</literal>. - </para> - </section> - </chapter> --- 1,28 ---- + <?xml version="1.0" encoding="ISO-8859-1"?> <chapter id="start"> <title>Getting Started</title> + <section id="start-install"> + <title>Installation</title> + + <para>Installation is simple. Just download the release zip and unzip + into the directory of your choice. If you have InfoZip, the command + could look something like: <screen>c:\temp> unzip DotNetMock-0.7.6.zip -d c:\sw\dotnet\dotnetmock-0.7.6</screen> + Afterwards, you could register the assemblies with the GAC.</para> + </section> + + <section id="start-using"> + <title>Using DotNetMock in Your Projects</title> + + <para>To use <classname>DynamicMock</classname>s only, you add a + reference to <filename>DotNetMock.dll</filename>. If you want to use + the static mock library, then also add a reference to + <filename>DotNetMock.Framework.dll</filename>.</para> + + <para>You will also need add reference to a unit testing framework. + Currently, we support NUnit and MbUnit. We recommend that you set + "Copy Local" to true in the properties of the test framework + reference. DotNetMock binds to the testing framework dynamically so it + can support most versions of NUnit and MbUnit.</para> + </section> + </chapter> \ No newline at end of file Index: index.xml =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/doc/reference/src/index.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** index.xml 13 Feb 2005 10:49:49 -0000 1.1 --- index.xml 26 Feb 2005 19:41:20 -0000 1.2 *************** *** 1,66 **** ! <?xml version='1.0' encoding="iso-8859-1"?> <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" ! "../../docbook/lib/docbook-dtd/docbookx.dtd" ! [ ! <!ENTITY preface SYSTEM "preface.xml"> ! <!ENTITY start SYSTEM "start.xml"> ! <!ENTITY dynamic SYSTEM "dynamic.xml"> ! <!ENTITY static SYSTEM "static.xml"> ! <!ENTITY xunit SYSTEM "xunit.xml"> ! <!ENTITY faq SYSTEM "faq.xml"> ]> <book> ! <bookinfo> ! <title>DotNetMock - Mock Objects for .NET</title> ! <subtitle>Reference Documentation</subtitle> ! <releaseinfo>Version 0.7.4</releaseinfo> ! <pubdate>February 12, 2005 - (Work in progress)</pubdate> ! <authorgroup> ! <author> ! <firstname>Griffin</firstname> ! <surname>Caprio</surname> ! </author> ! <author> ! <firstname>Choy</firstname> ! <surname>Rim</surname> ! </author> ! </authorgroup> ! <legalnotice> ! <para> ! Copies of this document may be made for your own use and for ! distribution to others, provided that you do not charge any fee for such ! copies and further provided that each copy contains this Copyright ! Notice, whether distributed in print or electronically. ! </para> ! </legalnotice> ! </bookinfo> ! <toc/> ! <preface id="preface-ack"> ! <title>Acknowledgements</title> ! <para> ! This project and many others owe a debt of gratitude to Chris Bauer ! (of the <ulink url="http://www.hibernate.org/">Hibernate</ulink> ! project team), who prepared and adapted the DocBook-XSL software ! used to create Hibernate's reference guide, allowing us to create ! this guide. ! </para> ! </preface> ! <preface id="preface-intro"> ! <title>Introduction</title> ! <para> ! DotNetMock is a framework and library which facilitates the use of ! mock objects for unit testing on the .NET platform. It supports the ! dynamic creation of mock objects and the development of custom mock ! objects. It also contains a library of pre-built mock objects for ! typical purposes. It integrates with the NUnit, MbUnit and csUnit ! testing frameworks. ! </para> ! </preface> ! &start; ! &dynamic; ! &static; ! &xunit; ! &faq; ! </book> --- 1,134 ---- ! <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" ! "../../docbook/lib/docbook-dtd/docbookx.dtd" [ ! <!ENTITY start SYSTEM "start.xml"> ! <!ENTITY dynamic SYSTEM "dynamic.xml"> ! <!ENTITY static SYSTEM "static.xml"> ! <!ENTITY xunit SYSTEM "xunit.xml"> ! <!ENTITY faq SYSTEM "faq.xml"> ]> <book> ! <bookinfo> ! <title>DotNetMock - Mock Objects for .NET</title> ! ! <subtitle>Reference Documentation</subtitle> ! ! <releaseinfo>Version 0.7.6</releaseinfo> ! ! <pubdate>February 26, 2005 - (Work in progress)</pubdate> ! ! <authorgroup> ! <author> ! <firstname>Griffin</firstname> ! ! <surname>Caprio</surname> ! </author> ! ! <author> ! <firstname>Choy</firstname> ! ! <surname>Rim</surname> ! </author> ! </authorgroup> ! ! <legalnotice> ! <para>Copies of this document may be made for your own use and for ! distribution to others, provided that you do not charge any fee ! for such copies and further provided that each copy contains this ! Copyright Notice, whether distributed in print or ! electronically.</para> ! </legalnotice> ! </bookinfo> ! ! <toc></toc> ! ! <preface id="preface-ack"> ! <title>Acknowledgements</title> ! ! <para>This project and many others owe a debt of gratitude to Chris ! Bauer (of the <ulink url="http://www.hibernate.org/">Hibernate</ulink> ! project team), who prepared and adapted the DocBook-XSL software used ! to create Hibernate's reference guide, allowing us to create this ! guide.</para> ! </preface> ! ! <preface id="preface-intro"> ! <title>Introduction</title> ! ! <para>DotNetMock is a framework and library which facilitates the use ! of mock objects for unit testing on the .NET platform. It supports the ! dynamic creation of mock objects and the development of custom mock ! objects. It also contains a library of pre-built mock objects for ! typical purposes. It integrates with the NUnit, and MbUnit testing ! frameworks.</para> ! ! <section> ! <title>What is a Mock Object?</title> ! ! <para>From the <ulink ! url="http://www.mockobjects.com/Faq.html">mockobjects.com</ulink> ! website,</para> + <para><quote>A mock object is a "double agent" used to test the + behaviour of other objects. First, a mock object acts as a faux + implementation of an interface or class that mimics the external + behaviour of a true implementation. Second, a mock object observes + how other objects interact with its methods and compares actual + behaviour with preset expectations. When a discrepancy occurs, a + mock object can interrupt the test and report the anomaly. If the + discrepancy cannot be noted during the test, a verification method + called by the tester ensures that all expectations have been met + or failures reported.</quote></para> + <para>Mocking objects is a technique that enables the test-driven + developer to keep focus on the class he is currently developing by + providing something for his incomplete class to collaborate with. + This is a powerful and effective way to maintain momentum in a + test-driven environment.</para> + </section> + + <section> + <title>How Do I Use Mock Objects?</title> + + <para>The canonical approach to using mock objects involves the + following steps (also from <ulink + url="http://www.mockobjects.com/CommonStructureForTestsWithMockObjects.html">mockobjects.com</ulink>):</para> + + <para><orderedlist> + <listitem> + <para>Create context, including mock objects (common + context might be created in the setUp method).</para> + </listitem> + + <listitem> + <para>Define expectations on the mock objects.</para> + </listitem> + + <listitem id="mockobjects-canonical-steps-execute"> + <para>Execute the behaviour to be tested (often within + in an assert statement).</para> + </listitem> + + <listitem> + <para>Verify expectations.</para> + </listitem> + + <listitem> + <para>Assert additional post conditions not checked in + step 3.</para> + </listitem> + </orderedlist>We will see examples of this later in the + text.</para> + </section> + </preface> + + &start; + + &dynamic; + + &static; + + &xunit; + + &faq; + </book> \ No newline at end of file Index: dynamic.xml =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/doc/reference/src/dynamic.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dynamic.xml 13 Feb 2005 10:49:49 -0000 1.1 --- dynamic.xml 26 Feb 2005 19:41:20 -0000 1.2 *************** *** 1,11 **** <chapter id="dynamic"> ! <title>Dynamically Generated Mocks</title> <section id="dynamic-introduction"> ! <title>Introduction</title> ! <para> ! Dynamic mocks are mock objects created by dynamically implementing ! ... ! </para> ! </section> ! </chapter> --- 1,10 ---- + <?xml version="1.0" encoding="ISO-8859-1"?> <chapter id="dynamic"> ! <title>Dynamic Mocks</title> ! <section id="dynamic-introduction"> ! <title>Introduction</title> + <para>Dynamic mocks are mock objects created at runtime.</para> + </section> + </chapter> \ No newline at end of file |