You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(31) |
Dec
(26) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(8) |
Feb
(27) |
Mar
(15) |
Apr
|
May
(2) |
Jun
(13) |
Jul
(59) |
Aug
(48) |
Sep
(9) |
Oct
(4) |
Nov
(24) |
Dec
|
| 2004 |
Jan
(24) |
Feb
(2) |
Mar
(12) |
Apr
(9) |
May
(4) |
Jun
(26) |
Jul
(20) |
Aug
(23) |
Sep
(13) |
Oct
(31) |
Nov
(23) |
Dec
(11) |
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
(19) |
May
(64) |
Jun
(7) |
Jul
(20) |
Aug
(1) |
Sep
(6) |
Oct
|
Nov
(3) |
Dec
|
| 2006 |
Jan
|
Feb
(69) |
Mar
(18) |
Apr
(1) |
May
(4) |
Jun
(3) |
Jul
(27) |
Aug
(19) |
Sep
(12) |
Oct
(3) |
Nov
(13) |
Dec
(6) |
| 2007 |
Jan
(20) |
Feb
(17) |
Mar
(1) |
Apr
(3) |
May
(4) |
Jun
(11) |
Jul
(10) |
Aug
(24) |
Sep
(19) |
Oct
(13) |
Nov
(8) |
Dec
(7) |
| 2008 |
Jan
(54) |
Feb
(24) |
Mar
(11) |
Apr
(35) |
May
(13) |
Jun
(10) |
Jul
(30) |
Aug
(18) |
Sep
(21) |
Oct
(18) |
Nov
(40) |
Dec
(76) |
| 2009 |
Jan
(64) |
Feb
(23) |
Mar
(15) |
Apr
(23) |
May
(46) |
Jun
(25) |
Jul
(31) |
Aug
(7) |
Sep
(7) |
Oct
(6) |
Nov
(15) |
Dec
(19) |
| 2010 |
Jan
(13) |
Feb
(8) |
Mar
(6) |
Apr
(4) |
May
(8) |
Jun
(7) |
Jul
(3) |
Aug
(9) |
Sep
(6) |
Oct
(15) |
Nov
(3) |
Dec
(5) |
| 2011 |
Jan
(1) |
Feb
|
Mar
(4) |
Apr
(5) |
May
(2) |
Jun
|
Jul
(2) |
Aug
(2) |
Sep
(2) |
Oct
(4) |
Nov
(2) |
Dec
(3) |
| 2012 |
Jan
(6) |
Feb
(2) |
Mar
(3) |
Apr
(3) |
May
(3) |
Jun
(1) |
Jul
|
Aug
|
Sep
(2) |
Oct
(2) |
Nov
|
Dec
(1) |
| 2013 |
Jan
(3) |
Feb
(1) |
Mar
|
Apr
|
May
(1) |
Jun
(1) |
Jul
|
Aug
(5) |
Sep
|
Oct
(1) |
Nov
(2) |
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(1) |
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(1) |
| 2015 |
Jan
|
Feb
(19) |
Mar
(115) |
Apr
(23) |
May
(41) |
Jun
(48) |
Jul
(59) |
Aug
(29) |
Sep
(40) |
Oct
(78) |
Nov
(58) |
Dec
(47) |
| 2016 |
Jan
(25) |
Feb
(30) |
Mar
(29) |
Apr
(10) |
May
(17) |
Jun
(1) |
Jul
(1) |
Aug
(6) |
Sep
(2) |
Oct
(1) |
Nov
(3) |
Dec
(2) |
| 2017 |
Jan
(5) |
Feb
(2) |
Mar
(7) |
Apr
(1) |
May
(7) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
(5) |
Apr
|
May
(1) |
Jun
|
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
| 2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(3) |
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
(6) |
May
|
Jun
|
Jul
(29) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2021 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(5) |
Dec
(3) |
| 2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(5) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2023 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
(7) |
Jul
(1) |
Aug
|
Sep
(6) |
Oct
(4) |
Nov
(1) |
Dec
(4) |
| 2024 |
Jan
(2) |
Feb
(5) |
Mar
|
Apr
|
May
(8) |
Jun
(159) |
Jul
(90) |
Aug
(22) |
Sep
|
Oct
(6) |
Nov
(8) |
Dec
(1) |
| 2025 |
Jan
(20) |
Feb
(6) |
Mar
(2) |
Apr
(4) |
May
(29) |
Jun
(63) |
Jul
(62) |
Aug
(70) |
Sep
(120) |
Oct
(46) |
Nov
(33) |
Dec
(25) |
| 2026 |
Jan
(37) |
Feb
(56) |
Mar
(62) |
Apr
(26) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Owen R. <exo...@us...> - 2004-11-11 07:31:31
|
Update of /cvsroot/nmock/nmock In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28276 Modified Files: .cvsignore nmock.build Log Message: qualified sn.exe with absolute path (fixing the build) Index: .cvsignore =================================================================== RCS file: /cvsroot/nmock/nmock/.cvsignore,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** .cvsignore 17 Sep 2004 03:33:29 -0000 1.4 --- .cvsignore 11 Nov 2004 07:31:19 -0000 1.5 *************** *** 5,7 **** nmock.resharper nmock.resharperoptions ! _ReSharper.nmock \ No newline at end of file --- 5,9 ---- nmock.resharper nmock.resharperoptions ! _ReSharper.nmock ! nmock.snk ! StrongName.cs \ No newline at end of file Index: nmock.build =================================================================== RCS file: /cvsroot/nmock/nmock/nmock.build,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** nmock.build 5 Nov 2004 15:34:22 -0000 1.12 --- nmock.build 11 Nov 2004 07:31:20 -0000 1.13 *************** *** 58,62 **** <target name="keypair" description="Generate strong name key pair"> ! <exec program="sn" commandline="-k"> <arg value="${nmock.keypair}" /> </exec> --- 58,62 ---- <target name="keypair" description="Generate strong name key pair"> ! <exec program="${nant.settings.currentframework.sdkdirectory}\sn.exe" commandline="-q -k"> <arg value="${nmock.keypair}" /> </exec> |
|
From: Levi K. <lkh...@us...> - 2004-11-05 15:35:07
|
Update of /cvsroot/nmock/nmock In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17810 Modified Files: nmock.build Log Message: Added assembly strong name signing to release target Index: nmock.build =================================================================== RCS file: /cvsroot/nmock/nmock/nmock.build,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** nmock.build 22 Oct 2004 12:23:50 -0000 1.11 --- nmock.build 5 Nov 2004 15:34:22 -0000 1.12 *************** *** 3,7 **** <property name="nant.settings.currentframework" value="net-1.1"/> <property name="nunit.output" value="Plain"/> ! <target name="init"> <mkdir dir="build"/> --- 3,13 ---- <property name="nant.settings.currentframework" value="net-1.1"/> <property name="nunit.output" value="Plain"/> ! ! <property name="nmock.keypair" value="${nant.project.basedir}\nmock.snk"/> ! <property name="nmock.sninfo" value="${nant.project.basedir}\StrongName.cs"/> ! ! <property name="nmock.build" value="*" overwrite="false"/> ! <property name="nmock.version" value="1.1.${nmock.build}" overwrite="false"/> ! <target name="init"> <mkdir dir="build"/> *************** *** 38,43 **** <target name="test" depends="compile" description="Run unit tests"> <nunit2> ! <formatter type="${nunit.output}" /> ! <test assemblyname="build\nmock.test.dll" /> </nunit2> </target> --- 44,49 ---- <target name="test" depends="compile" description="Run unit tests"> <nunit2> ! <formatter type="${nunit.output}"/> ! <test assemblyname="build\nmock.test.dll"/> </nunit2> </target> *************** *** 51,55 **** </target> ! <target name="release" depends="clean, test" description="Generate release"> <mkdir dir="dist"/> <!-- recompile cleaner dll, without tests and samples and no debug symbols --> --- 57,79 ---- </target> ! <target name="keypair" description="Generate strong name key pair"> ! <exec program="sn" commandline="-k"> ! <arg value="${nmock.keypair}" /> ! </exec> ! </target> ! ! <target name="strongname" depends="keypair" description="Generate strong name include file"> ! <asminfo output="${nmock.sninfo}" language="CSharp"> ! <imports> ! <import name="System.Reflection"/> ! </imports> ! <attributes> ! <attribute type="AssemblyVersionAttribute" value="${nmock.version}" /> ! <attribute type="AssemblyKeyFileAttribute" value="${nmock.keypair}" /> ! </attributes> ! </asminfo> ! </target> ! ! <target name="release" depends="clean, test, strongname" description="Generate release"> <mkdir dir="dist"/> <!-- recompile cleaner dll, without tests and samples and no debug symbols --> *************** *** 57,60 **** --- 81,85 ---- <sources> <include name="src/**.cs"/> + <include name="${nmock.sninfo}"/> </sources> </csc> |
|
From: Levi K. <lkh...@us...> - 2004-11-05 15:34:47
|
Update of /cvsroot/nmock/nmock/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17810/src Modified Files: AssemblyInfo.cs Log Message: Added assembly strong name signing to release target Index: AssemblyInfo.cs =================================================================== RCS file: /cvsroot/nmock/nmock/src/AssemblyInfo.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AssemblyInfo.cs 16 Dec 2002 14:51:24 -0000 1.1 --- AssemblyInfo.cs 5 Nov 2004 15:34:23 -0000 1.2 *************** *** 1,4 **** using System.Reflection; - using System.Runtime.CompilerServices; // --- 1,3 ---- *************** *** 15,58 **** [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] - - // - // Version information for an assembly consists of the following four values: - // - // Major Version - // Minor Version - // Build Number - // Revision - // - // You can specify all the values or you can default the Revision and Build Numbers - // by using the '*' as shown below: - - [assembly: AssemblyVersion("1.0.*")] - - // - // In order to sign your assembly you must specify a key to use. Refer to the - // Microsoft .NET Framework documentation for more information on assembly signing. - // - // Use the attributes below to control which key is used for signing. - // - // Notes: - // (*) If no key is specified, the assembly is not signed. - // (*) KeyName refers to a key that has been installed in the Crypto Service - // Provider (CSP) on your machine. KeyFile refers to a file which contains - // a key. - // (*) If the KeyFile and the KeyName values are both specified, the - // following processing occurs: - // (1) If the KeyName can be found in the CSP, that key is used. - // (2) If the KeyName does not exist and the KeyFile does exist, the key - // in the KeyFile is installed into the CSP and used. - // (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. - // When specifying the KeyFile, the location of the KeyFile should be - // relative to the project output directory which is - // %Project Directory%\obj\<configuration>. For example, if your KeyFile is - // located in the project directory, you would specify the AssemblyKeyFile - // attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] - // (*) Delay Signing is an advanced option - see the Microsoft .NET Framework - // documentation for more information on this. - // - [assembly: AssemblyDelaySign(false)] - [assembly: AssemblyKeyFile("")] - [assembly: AssemblyKeyName("")] --- 14,15 ---- |
|
From: Levi K. <LKh...@th...> - 2004-11-04 20:01:43
|
Owen,
I'm getting the following error since I updated to the latest build script
that you committed on 10/22/04, the one that uses newer NAnt and NUnit 2.2
:
C:\Work\nmock\nmock.build(39,4):
Failure executing test(s). If you assembly is not built using NUnit
version 2.2.0.0, then ensure you have redirected assembly bindings.
Consult the documentation of the <nunit2> task for more information.
File or assembly name 'nunit.util, Version=2.2.0.0, Culture=neutral,
PublicKeyToken=null', or one of its dependencies, was not found.
The system cannot find the file specified.
I see you've added nunit.util.dll to tools/lib/net/1.1 directory, but how
does nant know to look in there? It's not in the probing path.
I want to clarify this with you before I start adding assembly singing to
the build script.
Thanks,
- Levi
|
|
From: Mike R. <mik...@gm...> - 2004-11-03 20:49:29
|
I suggest you do what we do on CCNet and that's to use <exec> . Make
sure that the nunit.framework and nunit.core you're compiling against
are *exactly* the ones you are running with, make sure both
nunit.framework and nunit.core are in the directory of the assembly
you're testing, and make sure you don't have any nunit's installed in
your GAC.
Here's a line from the CCNet build file as an example. I know that
there's properties in it but hopefully you get the picture.
<exec program="${nunit-console.exe}"
workingdir="${build.dir}\core" commandline="${core.dll}
/xml:../${core.dll}-results.xml /nologo"/>
Let me know if you have any more problems.
Mike
On Wed, 3 Nov 2004 09:57:13 -0600, Levi Khatskevitch
<lkh...@th...> wrote:
>
> I'm having a problem with the build script ever since we've moved to NUnit
> 2.2. Here's the error I'm getting:
>
> C:\Work\nmock\nmock.build(39,4):
> Failure executing test(s). If you assembly is not built using NUnit version
> 2.2.0.0, then ensure you have redirected assembly bindings. Consult the
> documentation of the <nunit2> task for more information.
> File or assembly name 'nunit.util, Version=2.2.0.0, Culture=neutral,
> PublicKeyToken=null', or one of its dependencies, was not found.
> The system cannot find the file specified.
>
> If I copy nunit.util.dll into tools directory it works just fine, however
> since this file is already exists in tools\lib\net\1.1 I thought I'd ask if
> anyone else can reproduce the problem before trying to figure it out myself
>
> Thanks,
> - Levi
>
--
mike roberts | http://mikeroberts.thoughtworks.net/ |
http://www.thoughtworks.com/
|
|
From: Levi K. <LKh...@th...> - 2004-11-03 15:56:10
|
I'm having a problem with the build script ever since we've moved to NUnit
2.2. Here's the error I'm getting:
C:\Work\nmock\nmock.build(39,4):
Failure executing test(s). If you assembly is not built using NUnit
version 2.2.0.0, then ensure you have redirected assembly bindings.
Consult the documentation of the <nunit2> task for more information.
File or assembly name 'nunit.util, Version=2.2.0.0, Culture=neutral,
PublicKeyToken=null', or one of its dependencies, was not found.
The system cannot find the file specified.
If I copy nunit.util.dll into tools directory it works just fine, however
since this file is already exists in tools\lib\net\1.1 I thought I'd ask
if anyone else can reproduce the problem before trying to figure it out
myself
Thanks,
- Levi
|
|
From: Steve F. <st...@m3...> - 2004-11-01 16:25:47
|
Have you looked at how jmock works? Nat will be rolling onto a .Net
project soon, so I expect we'll finally have someone with the motivation
to do something about a port (making promises on his behalf).
S.
Levi Khatskevitch wrote:
> I had the same idea a while ago, but how would you handle argument
> constraints like NotNull() that do not specify the argument type? Losing
> them will make expectations more verbose but on the other hand requiring
> too precise expectations often results in unit tests that follow real code
> too closely - a common problem with interaction base testing that I've
> seen.
>
> Recently I was thinking about resolving methods to the first expectation
> in the call sequence where argument types match. This preserves the
> flexibility but also supports overloading in a more consistent way. For
> example:
>
> mock.Expect("Foo", new IsAnything()); // expect either overload
> mock.Expect("Foo", (int)1); // expect Foo(int) overload
> mock.Expect("Foo", (double)1.2); // expect Foo(double) overload
>
> mock.Invoke("Foo", 2); // ok, resolved to the first expectation
> mock.Invoke("Foo", 1.0); // fail, resolves to the third expectation and
> thus should be 1.2
>
> Any thoughts on this?
>
> Regards,
> - Levi
>
>
>
>
> Jim Arnold <JA...@th...>
> Sent by: nmo...@li...
> 11/01/2004 08:41 AM
>
> To
> nmo...@li...
> cc
>
> Subject
> [Nmock-general] MethodSignature and friends
>
>
>
>
>
>
> The method resolution in NMock is really starting to annoy me :-) It
> works for simple cases (find a method named "Foo" with a return type of
> "Bar"), but complex scenarios with overloads and indexed properties are
> still buggy. The fundamental problem is that the user is not forced to
> specify the attributes necessary to find a method. SetupResult() can just
> take a method name and a return value, which is really not enough to
> resolve overloaded properties.
>
> We should just get rid of the whole MethodSignature thing and start using
> real MethodInfos and PropertyInfos instead. It might make the public API
> slightly more complex, but would close a whole class of bugs.
>
> Can I get a +/- 1 from anybody?
>
> Jim
> ------------------------------------------------------- This SF.Net email
> is sponsored by: Sybase ASE Linux Express Edition - download now for FREE
> LinuxWorld Reader's Choice Award Winner for best database on Linux.
> http://ads.osdn.com/?ad_idU88&alloc_id065&op=click
> _______________________________________________ Nmock-general mailing list
> Nmo...@li...
> https://lists.sourceforge.net/lists/listinfo/nmock-general
>
|
|
From: Levi K. <LKh...@th...> - 2004-11-01 16:16:36
|
I had the same idea a while ago, but how would you handle argument=20
constraints like NotNull() that do not specify the argument type? Losing=20
them will make expectations more verbose but on the other hand requiring=20
too precise expectations often results in unit tests that follow real code =
too closely - a common problem with interaction base testing that I've=20
seen.
Recently I was thinking about resolving methods to the first expectation=20
in the call sequence where argument types match. This preserves the=20
flexibility but also supports overloading in a more consistent way. For=20
example:
mock.Expect("Foo", new IsAnything()); // expect either overload
mock.Expect("Foo", (int)1); // expect Foo(int) overload
mock.Expect("Foo", (double)1.2); // expect Foo(double) overload
mock.Invoke("Foo", 2); // ok, resolved to the first expectation
mock.Invoke("Foo", 1.0); // fail, resolves to the third expectation and=20
thus should be 1.2
Any thoughts on this?
Regards,
- Levi
Jim Arnold <JA...@th...>=20
Sent by: nmo...@li...
11/01/2004 08:41 AM
To
nmo...@li...
cc
Subject
[Nmock-general] MethodSignature and friends
The method resolution in NMock is really starting to annoy me :-) It=20
works for simple cases (find a method named "Foo" with a return type of=20
"Bar"), but complex scenarios with overloads and indexed properties are=20
still buggy. The fundamental problem is that the user is not forced to=20
specify the attributes necessary to find a method. SetupResult() can just =
take a method name and a return value, which is really not enough to=20
resolve overloaded properties.
=20
We should just get rid of the whole MethodSignature thing and start using=20
real MethodInfos and PropertyInfos instead. It might make the public API=20
slightly more complex, but would close a whole class of bugs.
=20
Can I get a +/- 1 from anybody?
=20
Jim
------------------------------------------------------- This SF.Net email=20
is sponsored by: Sybase ASE Linux Express Edition - download now for FREE=20
LinuxWorld Reader's Choice Award Winner for best database on Linux.=20
http://ads.osdn.com/?ad=5FidU88&alloc=5Fid=12065&op=3Dclick=20
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F Nmock-ge=
neral mailing list=20
Nmo...@li...=20
https://lists.sourceforge.net/lists/listinfo/nmock-general=20
|
|
From: Jim A. <JA...@th...> - 2004-11-01 13:40:49
|
<FONT face=3D"Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size= =3D2><div>The method resolution in NMock is really starting to annoy me :-)= It works for simple cases (find a method named "Foo" with a return t= ype of "Bar"), but complex scenarios with overloads and indexed prope= rties are still buggy. The fundamental problem is that the user is no= t forced to specify the attributes necessary to find a method. SetupR= esult() can just take a method name and a return value, which is really not= enough to resolve overloaded properties.</div><DIV> </DIV><DIV>We sho= uld just get rid of the whole MethodSignature thing and start using real Me= thodInfos and PropertyInfos instead. It might make the public AP= I slightly more complex, but would close a whole class of bugs.</DIV><DIV>&= nbsp;</DIV><DIV>Can I get a +/- 1 from anybody?</DIV><DIV> </DIV><DIV>= Jim</DIV></FONT>= |
|
From: Jim A. <JA...@th...> - 2004-11-01 10:18:56
|
<FONT face=3D"Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size= =3D2><DIV>Thibaut,</DIV><DIV> </DIV><DIV>( If you're still out there := -) )</DIV><DIV><BR>You probably already know the standard mocking theory - = you mock the classes which interact with class you are testing. If yo= u are testing the receiver, you should mock the server. The fact that= you have more than one server implementation should make no difference if = they all conform to the same interface (you are only testing the receiver's= actions after all).</DIV><DIV> </DIV><DIV>If you need to test the ser= ver, by all means create a mock client, but it sounds like you need both na= tive (or managed, at least) C++ unit tests *and* some kind of end-to-end te= st for the entire piece.</DIV><DIV> </DIV><DIV>Does that help at all?<= /DIV><DIV> </DIV><DIV>Jim</DIV><DIV> </DIV><DIV>ThoughtWorks</DIV= ><DIV> </DIV><FONT color=3D#990099>-----nmo...@li...= ceforge.net wrote: -----<BR><BR></FONT><blockquote style=3D"PADDING-RIGHT: = 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; M= ARGIN-RIGHT: 0px">To: nmo...@li...<BR>From: Thibaut = Barr=E8re <thi...@gm...><BR>Sent by: nmock-general-admin= @lists.sourceforge.net<BR>Date: 10/19/2004 09:38AM<BR>Subject: [Nmock-gener= al] Re: Mocking callback functions<BR><BR><FONT face=3Dmonospace size=3D2>A= nyone ? Or am I on the wrong list ?<BR><BR>regards<BR><BR>Thibaut<BR><BR><B= R>On Thu, 14 Oct 2004 11:00:26 +0200, Thibaut Barr=E8re<BR><THIBAUT.BARRERE= @GMAIL.COM>wrote:<BR>> Hi gentlemen,<BR>> <BR>> I'm really new to = mock objects, apart from very basic stuff, and would<BR>> like to have y= our opinion about the way I plan to use them.<BR>> <BR>> I am testing= interaction with remote servers, and I'm expecting to be<BR>> called in= one of several callbacks (registered to the server) in my<BR>> testfixt= ure to decide that my test has passed. Callbacks, if called,<BR>> set an= AutoResetEvent. I'm currently testing the behaviour using this<BR>> :<B= R>> <BR>> AutoResetEvent =5Fconnected =3D new AutoResetEvent(false);<= BR>> <BR>> /// <SUMMARY><BR>> /// Callback for connect test<BR>>= ; /// </SUMMARY><BR>> /// <PARAM name=3D"e"></PARAM><BR>> private v= oid Connected(object sender,ConnectionEventArgs e)<BR>> {<BR>> = // mark the event<BR>> = =5Fconnected.Set();<BR>> }<BR>> <BR>> ....<BR>> <BR>> WaitHa= ndle[] handles =3D { =5Faccepted,=5Frejected,=5Fcancelled };<BR>> Assert= .IsTrue(WaitHandle.WaitAny(handles,5000,true)!=3DWaitHandle.WaitTimeout,"No= <BR>> valid callback called.");<BR>> <BR>> I'm thinking about refa= ctoring the callbacks and waitany code inside a<BR>> mock object, with s= ome "expectations" that would do what I need. I<BR>> would then mock the= receiver, not the server.<BR>> <BR>> To give more background, the re= mote servers (~ 10 different<BR>> implementations, native c++ code) are = wrapped behind a common managed<BR>> c++ proxy interface. I couldn't man= age to see the benefits of just<BR>> mocking one of the remote server, a= s it would not test the real thing.<BR>> <BR>> What do you think of m= ocking the receiver ? Could I do better here ?<BR>> Am I totally wrong s= omewhere ?<BR>> <BR>> thanks in advance<BR>> <BR>> Thibaut<BR>&= gt;<BR><BR><BR>-------------------------------------------------------<BR>T= his SF.net email is sponsored by: IT Product Guide on ITManagersJournal<BR>= Use IT products in your business? Tell us what you think of them. Give us<B= R>Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out mo= re<BR><A href=3D"http://productguide.itmanagersjournal.com/guidepromo.tmpl"= target=3Dblank >http://productguide.itmanagersjournal.com/guidepromo.tmpl= </A><BR>=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= <BR>Nmock-general mailing list<BR>Nmo...@li...<BR><A= href=3D"https://lists.sourceforge.net/lists/listinfo/nmock-general" target= =3Dblank >https://lists.sourceforge.net/lists/listinfo/nmock-general</A><BR= ></FONT></blockquote><br></FONT>= |
|
From: Jim A. <JA...@th...> - 2004-10-29 09:17:04
|
<FONT face=3D"Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size= =3D2><DIV>+1</DIV><DIV> </DIV><DIV>Jim</DIV><DIV><BR> </DIV><FONT= color=3D#990099>-----nmo...@li... wrote: ----= -<BR><BR></FONT><blockquote style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px;= MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">To: O= wen Rogers <or...@th...><BR>From: Mike Roberts <mike.= b.r...@gm...><BR>Sent by: nmo...@li....n= et<BR>Date: 10/28/2004 08:55PM<BR>cc: Levi Khatskevitch <lkhatske@though= tworks.com>, nmo...@li...<BR>Subject: Re: [Nmock-= general] Re: Strong naming nmock.dll<BR><BR><FONT face=3Dmonospace size=3D2= >+1 to strong-naming assemblies.<BR><BR>-1 to keeping unit tests in the sam= e assemblies as the code they are<BR>testing. But that's just my opinion...= <BR><BR>Mike<BR><BR>On Thu, 28 Oct 2004 21:34:21 +0630, Owen Rogers<BR><ORO= GE...@TH...>wrote:<BR>> <BR>> definitely +1. i = was going through and doing this for some of my other<BR>> projects this= weekend. it's long overdue for nmock. <BR>> cheers, <BR>> owen= . <BR>> <BR>> <BR>> ---<BR>> R. Owen Rogers<B= R>> ThoughtWorks Technologies (India) Pvt Ltd.<BR>> <BR>&= gt; ThoughtWorks - Deliver with passion!<BR>> <BR>>  = ;ThoughtWorks is always looking for talented people who are passionate abou= t<BR>> technology. To find out more about a career at ThoughtWorks= go to<BR>> <A href=3D"http://www.thoughtworks.com/career/" target=3Db= lank>http://www.thoughtworks.com/career/</A>. <BR>> <BR>>  = ;<BR>> <BR>> Levi Khatskevitch <BR>> <BR>> 28/10/20= 04 21:32 <BR>> T= o: nmo...@li... <BR>> = cc: Owen Rogers/Cana= da/ThoughtWorks@ThoughtWorks <BR>> Subject: = Strong naming nmock.dll <BR>> <BR>> = On my current project we keep most of our unit tests in the same assembly a= s<BR>> the code they're testing. There are two reasons for that: <BR>>= ; <BR>> 1) It keeps things simple with regards to references and t= he number of<BR>> assemblies involved <BR>> 2) It's easy to test inte= rnal types since we don't have to make them public<BR>> or use reflectio= n <BR>> <BR>> We keep tests in a sub-folder within each project= and exclude it from<BR>> release builds. <BR>> <BR>> It all= worked nicely until we needed to strong name one of our assemblies<BR>>= since strongly named assemblies obviously can't reference non-strongly nam= ed<BR>> nmock.dll. I see no harm in strongly naming nmock.dll, especiall= y since<BR>> NUnit.Framework.dll is already strongly named. So if I don'= t hear any<BR>> objections from you I'll just go ahead and add signing t= o the NAnt build<BR>> script. <BR>> <BR>> Please tell me if = you think it's a bad idea. <BR>> <BR>> Regards, <BR>> = - Levi <BR>> <BR><BR><BR>-- <BR>mike roberts | <A href=3D"http://m= ikeroberts.thoughtworks.net/" target=3Dblank >http://mikeroberts.thoughtwo= rks.net/</A>|<BR><A href=3D"http://www.thoughtworks.com/" target=3Dblank >= http://www.thoughtworks.com/</A><BR><BR><BR>-------------------------------= ------------------------<BR>This Newsletter Sponsored by: Macrovision <BR>F= or reliable Linux application installations, use the industry's leading<BR>= setup authoring tool, InstallShield X. Learn more and evaluate <BR>today. <= A href=3D"http://clk.atdmt.com/MSI/go/ins0030000001msi/direct/01/" target= =3Dblank >http://clk.atdmt.com/MSI/go/ins0030000001msi/direct/01/</A><BR>= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F<BR>Nmock= -general mailing list<BR>Nmo...@li...<BR><A href=3D"= https://lists.sourceforge.net/lists/listinfo/nmock-general" target=3Dblank = >https://lists.sourceforge.net/lists/listinfo/nmock-general</A><BR></FONT><= /blockquote><br></FONT>= |
|
From: Mike R. <mik...@gm...> - 2004-10-28 19:55:54
|
+1 to strong-naming assemblies. -1 to keeping unit tests in the same assemblies as the code they are testing. But that's just my opinion... Mike On Thu, 28 Oct 2004 21:34:21 +0630, Owen Rogers <or...@th...> wrote: > > definitely +1. i was going through and doing this for some of my other > projects this weekend. it's long overdue for nmock. > cheers, > owen. > > > --- > R. Owen Rogers > ThoughtWorks Technologies (India) Pvt Ltd. > > ThoughtWorks - Deliver with passion! > > ThoughtWorks is always looking for talented people who are passionate about > technology. To find out more about a career at ThoughtWorks go to > http://www.thoughtworks.com/career/. > > > > Levi Khatskevitch > > 28/10/2004 21:32 > To: nmo...@li... > cc: Owen Rogers/Canada/ThoughtWorks@ThoughtWorks > Subject: Strong naming nmock.dll > > On my current project we keep most of our unit tests in the same assembly as > the code they're testing. There are two reasons for that: > > 1) It keeps things simple with regards to references and the number of > assemblies involved > 2) It's easy to test internal types since we don't have to make them public > or use reflection > > We keep tests in a sub-folder within each project and exclude it from > release builds. > > It all worked nicely until we needed to strong name one of our assemblies > since strongly named assemblies obviously can't reference non-strongly named > nmock.dll. I see no harm in strongly naming nmock.dll, especially since > NUnit.Framework.dll is already strongly named. So if I don't hear any > objections from you I'll just go ahead and add signing to the NAnt build > script. > > Please tell me if you think it's a bad idea. > > Regards, > - Levi > -- mike roberts | http://mikeroberts.thoughtworks.net/ | http://www.thoughtworks.com/ |
|
From: Owen R. <OR...@th...> - 2004-10-28 16:17:28
|
definitely +1. i was going through and doing this for some of my other projects this weekend. it's long overdue for nmock. cheers, owen. --- R. Owen Rogers ThoughtWorks Technologies (India) Pvt Ltd. ThoughtWorks - Deliver with passion! ThoughtWorks is always looking for talented people who are passionate about technology. To find out more about a career at ThoughtWorks go to http://www.thoughtworks.com/career/. Levi Khatskevitch 28/10/2004 21:32 To: nmo...@li... cc: Owen Rogers/Canada/ThoughtWorks@ThoughtWorks Subject: Strong naming nmock.dll On my current project we keep most of our unit tests in the same assembly as the code they're testing. There are two reasons for that: 1) It keeps things simple with regards to references and the number of assemblies involved 2) It's easy to test internal types since we don't have to make them public or use reflection We keep tests in a sub-folder within each project and exclude it from release builds. It all worked nicely until we needed to strong name one of our assemblies since strongly named assemblies obviously can't reference non-strongly named nmock.dll. I see no harm in strongly naming nmock.dll, especially since NUnit.Framework.dll is already strongly named. So if I don't hear any objections from you I'll just go ahead and add signing to the NAnt build script. Please tell me if you think it's a bad idea. Regards, - Levi |
|
From: Levi K. <LKh...@th...> - 2004-10-28 16:01:13
|
On my current project we keep most of our unit tests in the same assembly as the code they're testing. There are two reasons for that: 1) It keeps things simple with regards to references and the number of assemblies involved 2) It's easy to test internal types since we don't have to make them public or use reflection We keep tests in a sub-folder within each project and exclude it from release builds. It all worked nicely until we needed to strong name one of our assemblies since strongly named assemblies obviously can't reference non-strongly named nmock.dll. I see no harm in strongly naming nmock.dll, especially since NUnit.Framework.dll is already strongly named. So if I don't hear any objections from you I'll just go ahead and add signing to the NAnt build script. Please tell me if you think it's a bad idea. Regards, - Levi |
|
From: Owen R. <exo...@us...> - 2004-10-22 12:24:02
|
Update of /cvsroot/nmock/nmock In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27533 Modified Files: nmock.build Log Message: fixing nant warnings Index: nmock.build =================================================================== RCS file: /cvsroot/nmock/nmock/nmock.build,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** nmock.build 22 Oct 2004 11:46:26 -0000 1.10 --- nmock.build 22 Oct 2004 12:23:50 -0000 1.11 *************** *** 74,89 **** <zip zipfile="dist\nmock.source.zip"> <fileset> ! <includes name="**\*" /> ! <excludes name="build\**\*" /> ! <excludes name="dist\**\*" /> ! <excludes name="tools\**\*" /> ! <excludes name="**\bin\**\*" /> ! <excludes name="**\obj\**\*" /> ! <excludes name="**\CVS\**\*" /> ! <excludes name="*.suo" /> ! <excludes name="*.resharper*" /> ! <excludes name="**\*.csproj.user" /> ! <excludes name="*.resharper*\**\*" /> </fileset> </zip> --- 74,89 ---- <zip zipfile="dist\nmock.source.zip"> <fileset> ! <include name="**\*" /> ! <exclude name="build\**\*" /> ! <exclude name="dist\**\*" /> ! <exclude name="tools\**\*" /> ! <exclude name="**\bin\**\*" /> ! <exclude name="**\obj\**\*" /> ! <exclude name="**\CVS\**\*" /> ! <exclude name="*.suo" /> ! <exclude name="*.resharper*" /> ! <exclude name="**\*.csproj.user" /> ! <exclude name="*.resharper*\**\*" /> </fileset> </zip> *************** *** 100,104 **** <copy todir="${publish.dir}"> <fileset basedir="dist"> ! <includes name="*"/> </fileset> </copy> --- 100,104 ---- <copy todir="${publish.dir}"> <fileset basedir="dist"> ! <include name="*"/> </fileset> </copy> |
|
From: Owen R. <exo...@us...> - 2004-10-22 12:19:27
|
Update of /cvsroot/nmock/nmock/tools/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26479/tools/lib Added Files: ICSharpCode.SharpCvsLib.Console.dll ICSharpCode.SharpCvsLib.dll ICSharpCode.SharpZipLib.dll Log Message: adding missing nant libs --- NEW FILE: ICSharpCode.SharpCvsLib.Console.dll --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ICSharpCode.SharpZipLib.dll --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ICSharpCode.SharpCvsLib.dll --- (This appears to be a binary file; contents omitted.) |
|
From: Owen R. <exo...@us...> - 2004-10-22 12:07:19
|
Update of /cvsroot/nmock/nmock In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24037 Removed Files: continuousintegration.build Log Message: removing ccnet bootstrappers --- continuousintegration.build DELETED --- |
|
From: Owen R. <exo...@us...> - 2004-10-22 12:07:18
|
Update of /cvsroot/nmock/nmock/ccnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24037/ccnet Removed Files: ccnet-nmock.bat ccnet.config Log Message: removing ccnet bootstrappers --- ccnet-nmock.bat DELETED --- --- ccnet.config DELETED --- |
|
From: Owen R. <exo...@us...> - 2004-10-22 11:47:09
|
Update of /cvsroot/nmock/nmock/test/NMock/Proxy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19470/test/NMock/Proxy Modified Files: MockRealProxyTest.cs Log Message: upgraded to nunit 2.2 upgraded to new version of NAnt Index: MockRealProxyTest.cs =================================================================== RCS file: /cvsroot/nmock/nmock/test/NMock/Proxy/MockRealProxyTest.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MockRealProxyTest.cs 13 Oct 2004 18:03:57 -0000 1.2 --- MockRealProxyTest.cs 22 Oct 2004 11:46:28 -0000 1.3 *************** *** 2,17 **** using System.Collections; using System.IO; - using System.Reflection; - using System.Reflection.Emit; - - - using NUnit.Framework; - using NMock; using NMock.Constraints; namespace NMock.Proxy { #region types ! public interface IThingy { void NoArgs(); --- 2,14 ---- using System.Collections; using System.IO; using NMock.Constraints; + using NUnit.Framework; namespace NMock.Proxy { + #region types ! ! public interface IThingy { void NoArgs(); *************** *** 42,60 **** { } ! ! public struct MyStruct { public int x; } ! ! class X { private IMock mock = null; ! ! string stringReturn() { return (string)mock.Invoke("stringReturn", new object[0]); } ! decimal decimalReturn() { return (decimal)mock.Invoke("decimalReturn", new object[0]); } ! MyStruct structReturn() { return (MyStruct)mock.Invoke("structReturn", new object[0]); } } ! public interface ISolidThingy { --- 39,68 ---- { } ! ! public struct MyStruct { public int x; } ! ! internal class X { private IMock mock = null; ! ! private string stringReturn() ! { ! return (string) mock.Invoke("stringReturn", new object[0]); ! } ! ! private decimal decimalReturn() ! { ! return (decimal) mock.Invoke("decimalReturn", new object[0]); ! } ! ! private MyStruct structReturn() ! { ! return (MyStruct) mock.Invoke("structReturn", new object[0]); ! } } ! public interface ISolidThingy { *************** *** 65,80 **** { // internal and protected internal methods must be overridable! ! public virtual string VirtualMethod() { return "xx"; } public abstract string AbstractMethod(); ! protected internal virtual string ProtectedInternalMethod() { return "xx"; } // cannot override ! public static string StaticMethod() { return "xx"; } ! public string NonVirtualMethod() { return "xx"; } ! internal string NonVirtualInternalMethod() { return "xx"; } ! private string privateMethod() { return "xx"; } ! protected virtual string protectedMethod() { return "xx"; } ! string defaultInternalMethod() { return "xx"; } ! public override string ToString() { return "xx"; } // method is ignored // implemented interface members/methods are defined as final (ie. non-virtual) --- 73,123 ---- { // internal and protected internal methods must be overridable! ! public virtual string VirtualMethod() ! { ! return "xx"; ! } ! public abstract string AbstractMethod(); ! ! protected internal virtual string ProtectedInternalMethod() ! { ! return "xx"; ! } // cannot override ! public static string StaticMethod() ! { ! return "xx"; ! } ! ! public string NonVirtualMethod() ! { ! return "xx"; ! } ! ! internal string NonVirtualInternalMethod() ! { ! return "xx"; ! } ! ! private string privateMethod() ! { ! return "xx"; ! } ! ! protected virtual string protectedMethod() ! { ! return "xx"; ! } ! ! private string defaultInternalMethod() ! { ! return "xx"; ! } ! ! public override string ToString() ! { ! return "xx"; ! } // method is ignored // implemented interface members/methods are defined as final (ie. non-virtual) *************** *** 85,101 **** } ! public class ClassWithInternalMethod { ! internal virtual string InternalMethod() { return "xx"; } } ! public enum MyEnum { ! A, B, C, D } public class ConcreteThing : MarshalByRefObject { ! public virtual void NoArgs() { Assertion.Fail("Should have been overriden"); } } --- 128,153 ---- } ! public class ClassWithInternalMethod { ! internal virtual string InternalMethod() ! { ! return "xx"; ! } } ! public enum MyEnum { ! A, ! B, ! C, ! D } public class ConcreteThing : MarshalByRefObject { ! public virtual void NoArgs() ! { ! Assert.Fail("Should have been overriden"); ! } } *************** *** 111,130 **** public class SimpleThingy : MarshalByRefObject, ISimpleThingy { ! void ISimpleThingy.NoArgs() { Assertion.Fail("Should have been overriden"); } } #endregion ! [TestFixture] public class MockRealProxyInvocationHandlerTest { ! public class InvocationHandlerImpl : IInvocationHandler { public string expectedMethodName; public bool wasCalled = false; ! public object Invoke(string methodName, params object[] args) { ! Assertion.AssertEquals("should be method name", expectedMethodName, methodName); ! Assertion.AssertEquals("Should be no args", 0, args.Length); wasCalled = true; return null; --- 163,186 ---- public class SimpleThingy : MarshalByRefObject, ISimpleThingy { ! void ISimpleThingy.NoArgs() ! { ! Assert.Fail("Should have been overriden"); ! } } #endregion ! [TestFixture] ! public class MockRealProxyInvocationHandlerTest { ! public class InvocationHandlerImpl : IInvocationHandler { public string expectedMethodName; public bool wasCalled = false; ! public object Invoke(string methodName, params object[] args) { ! Assert.AreEqual(expectedMethodName, methodName, "should be method name"); ! Assert.AreEqual(0, args.Length, "Should be no args"); wasCalled = true; return null; *************** *** 137,168 **** } ! [Test] public void CreateRealProxy() { InvocationHandlerImpl handler = new InvocationHandlerImpl(); ! MockRealProxy rp = new MockRealProxy(typeof(IThingy), handler); ! IThingy thingy = (IThingy)rp.GetTransparentProxy(); ! handler.expectedMethodName = "NoArgs"; thingy.NoArgs(); ! Assertion.Assert("Should have been called ", handler.wasCalled); } } ! [TestFixture] public class MockRealProxyTest { private MockRealProxy rp; private IMock mock; private IThingy thingy; ! ! [SetUp] public void SetUp() { mock = new Mock("Test Mock"); ! rp = new MockRealProxy(typeof(IThingy), mock); ! thingy = (IThingy)rp.GetTransparentProxy(); } ! [Test] public void CallMethodIsCalled() { mock.Expect("NoArgs"); --- 193,228 ---- } ! [Test] ! public void CreateRealProxy() { InvocationHandlerImpl handler = new InvocationHandlerImpl(); ! MockRealProxy rp = new MockRealProxy(typeof (IThingy), handler); ! IThingy thingy = (IThingy) rp.GetTransparentProxy(); ! handler.expectedMethodName = "NoArgs"; thingy.NoArgs(); ! Assert.IsTrue(handler.wasCalled, "Should have been called "); } } ! [TestFixture] ! public class MockRealProxyTest { private MockRealProxy rp; private IMock mock; private IThingy thingy; ! ! [SetUp] ! public void SetUp() { mock = new Mock("Test Mock"); ! rp = new MockRealProxy(typeof (IThingy), mock); ! thingy = (IThingy) rp.GetTransparentProxy(); } ! [Test] ! public void CallMethodIsCalled() { mock.Expect("NoArgs"); *************** *** 171,230 **** } ! [Test] public void CallMethodWithReturn() { object x = "sdfs"; mock.ExpectAndReturn("simpleReturn", x); object result = thingy.simpleReturn(); ! Assertion.AssertEquals(x, result); mock.Verify(); } ! [Test] public void CallMethodWithReturnAndCast() { string x = "sdfs"; mock.ExpectAndReturn("stringReturn", x); string result = thingy.stringReturn(); ! Assertion.AssertEquals(x, result); mock.Verify(); } ! [Test] public void CallMethodWithWeirdObjectReturn() { IThingy t = thingy; mock.ExpectAndReturn("AThingy", t); IThingy result = thingy.AThingy(); ! Assertion.AssertSame(thingy, result); mock.Verify(); } ! [Test] public void CallMethodWithReturnInt() { mock.ExpectAndReturn("intReturn", 7); int result = thingy.intReturn(); ! Assertion.AssertEquals(7, result); mock.Verify(); } ! [Test] public void CallMethodWithReturnBoxings() { mock.ExpectAndReturn("boolReturn", true); mock.ExpectAndReturn("doubleReturn", 1234567891234E+10); ! Assertion.Assert(thingy.boolReturn()); ! Assertion.AssertEquals(1234567891234E+10, thingy.doubleReturn()); mock.Verify(); } ! [Test] ! public void CallMethodWithReturnDecimal() { decimal d = new decimal(3); mock.ExpectAndReturn("decimalReturn", d); decimal result = thingy.decimalReturn(); ! Assertion.AssertEquals(new decimal(3), result); mock.Verify(); } ! [Test] ! public void CallMethodWithStruct() { MyStruct str = new MyStruct(); --- 231,295 ---- } ! [Test] ! public void CallMethodWithReturn() { object x = "sdfs"; mock.ExpectAndReturn("simpleReturn", x); object result = thingy.simpleReturn(); ! Assert.AreEqual(x, result); mock.Verify(); } ! [Test] ! public void CallMethodWithReturnAndCast() { string x = "sdfs"; mock.ExpectAndReturn("stringReturn", x); string result = thingy.stringReturn(); ! Assert.AreEqual(x, result); mock.Verify(); } ! [Test] ! public void CallMethodWithWeirdObjectReturn() { IThingy t = thingy; mock.ExpectAndReturn("AThingy", t); IThingy result = thingy.AThingy(); ! Assert.AreSame(thingy, result); mock.Verify(); } ! [Test] ! public void CallMethodWithReturnInt() { mock.ExpectAndReturn("intReturn", 7); int result = thingy.intReturn(); ! Assert.AreEqual(7, result); mock.Verify(); } ! [Test] ! public void CallMethodWithReturnBoxings() { mock.ExpectAndReturn("boolReturn", true); mock.ExpectAndReturn("doubleReturn", 1234567891234E+10); ! Assert.IsTrue(thingy.boolReturn()); ! Assert.AreEqual(1234567891234E+10, thingy.doubleReturn()); mock.Verify(); } ! [Test] ! public void CallMethodWithReturnDecimal() { decimal d = new decimal(3); mock.ExpectAndReturn("decimalReturn", d); decimal result = thingy.decimalReturn(); ! Assert.AreEqual(new decimal(3), result); mock.Verify(); } ! [Test] ! public void CallMethodWithStruct() { MyStruct str = new MyStruct(); *************** *** 232,254 **** mock.ExpectAndReturn("structReturn", str); MyStruct result = thingy.structReturn(); ! Assertion.AssertEquals(str, result); mock.Verify(); ! } ! ! [Test] public void CallMethodWithReturnEnum() { mock.ExpectAndReturn("getEnum", MyEnum.C); MyEnum result = thingy.getEnum(); ! Assertion.AssertEquals(MyEnum.C, result); mock.Verify(); } ! ! [Test] [ExpectedException(typeof(IOException))] public void CallMethodTheThrowsException() { ! mock.ExpectAndThrow("boolReturn", new System.IO.IOException()); thingy.boolReturn(); } ! [Test] public void CallMethodWithStringParameterExpectation() { mock.Expect("WithSimpleArg", new StartsWith("he")); --- 297,323 ---- mock.ExpectAndReturn("structReturn", str); MyStruct result = thingy.structReturn(); ! Assert.AreEqual(str, result); mock.Verify(); ! } ! ! [Test] ! public void CallMethodWithReturnEnum() { mock.ExpectAndReturn("getEnum", MyEnum.C); MyEnum result = thingy.getEnum(); ! Assert.AreEqual(MyEnum.C, result); mock.Verify(); } ! ! [Test] ! [ExpectedException(typeof (IOException))] ! public void CallMethodTheThrowsException() { ! mock.ExpectAndThrow("boolReturn", new IOException()); thingy.boolReturn(); } ! [Test] ! public void CallMethodWithStringParameterExpectation() { mock.Expect("WithSimpleArg", new StartsWith("he")); *************** *** 256,261 **** mock.Verify(); } ! ! [Test] public void CallMethodWithStringParameter() { mock.Expect("WithSimpleArg", "hello"); --- 325,331 ---- mock.Verify(); } ! ! [Test] ! public void CallMethodWithStringParameter() { mock.Expect("WithSimpleArg", "hello"); *************** *** 264,274 **** } ! [Test] public void CallMethodWithIntParameter() { mock.Expect("WithIntParam", 1); thingy.WithIntParam(1); mock.Verify(); ! } ! [Test] [ExpectedException(typeof(VerifyException))] public void CallMethodWithParamExpectationsThatFails() { mock.Expect("WithSimpleArg", new IsEqual("hello")); --- 334,348 ---- } ! [Test] ! public void CallMethodWithIntParameter() { mock.Expect("WithIntParam", 1); thingy.WithIntParam(1); mock.Verify(); ! } ! ! [Test] ! [ExpectedException(typeof (VerifyException))] ! public void CallMethodWithParamExpectationsThatFails() { mock.Expect("WithSimpleArg", new IsEqual("hello")); *************** *** 276,281 **** mock.Verify(); } ! ! [Test] public void CallMethodWithTwoParamExpectations() { mock.Expect("WithTwoArgs", new IsEqual("hello"), new IsEqual("world")); --- 350,356 ---- mock.Verify(); } ! ! [Test] ! public void CallMethodWithTwoParamExpectations() { mock.Expect("WithTwoArgs", new IsEqual("hello"), new IsEqual("world")); *************** *** 283,288 **** mock.Verify(); } ! ! [Test] [ExpectedException(typeof(VerifyException))] public void CallMethodWithTwoParamExpectationsThatFails() { mock.Expect("WithTwoArgs", new IsEqual("hello"), new IsEqual("world")); --- 358,365 ---- mock.Verify(); } ! ! [Test] ! [ExpectedException(typeof (VerifyException))] ! public void CallMethodWithTwoParamExpectationsThatFails() { mock.Expect("WithTwoArgs", new IsEqual("hello"), new IsEqual("world")); *************** *** 290,295 **** mock.Verify(); } ! ! [Test] public void CallMethodWithThreeParamExpectations() { mock.Expect("WithThreeArgs", new IsEqual("hello"), new IsEqual("the"), new IsEqual("world")); --- 367,373 ---- mock.Verify(); } ! ! [Test] ! public void CallMethodWithThreeParamExpectations() { mock.Expect("WithThreeArgs", new IsEqual("hello"), new IsEqual("the"), new IsEqual("world")); *************** *** 297,302 **** mock.Verify(); } ! ! [Test] public void CallMethodWithLotsOfArgsExpectations() { mock.Expect("WithLotsOfArgs", new IsEqual("hello"), new IsEqual("world"), new IsEqual("is"), new IsEqual("this"), new IsEqual("the"), new IsEqual("end")); --- 375,381 ---- mock.Verify(); } ! ! [Test] ! public void CallMethodWithLotsOfArgsExpectations() { mock.Expect("WithLotsOfArgs", new IsEqual("hello"), new IsEqual("world"), new IsEqual("is"), new IsEqual("this"), new IsEqual("the"), new IsEqual("end")); *************** *** 305,309 **** } ! [Test] public void CallMethodWithOtherArgs() { IList l = new ArrayList(); --- 384,389 ---- } ! [Test] ! public void CallMethodWithOtherArgs() { IList l = new ArrayList(); *************** *** 312,322 **** mock.Verify(); } ! [Test] public void CallMethodWithVariableNumberOfParams() { ! mock.Expect("WithParams", 1, new object[]{"string1", "string2"}); thingy.WithParams(1, "string1", "string2"); mock.Verify(); } ! [Test] public void CallMethodWithLongParam() { mock.Expect("WithLongParam", 5L); --- 392,406 ---- mock.Verify(); } ! ! [Test] ! public void CallMethodWithVariableNumberOfParams() { ! mock.Expect("WithParams", 1, new object[] {"string1", "string2"}); thingy.WithParams(1, "string1", "string2"); mock.Verify(); } ! ! [Test] ! public void CallMethodWithLongParam() { mock.Expect("WithLongParam", 5L); *************** *** 325,332 **** } ! [Test] public void CallMethodOfImplementedInterface() { ! rp = new MockRealProxy(typeof(SimpleThingy), mock); ! ISimpleThingy thingy = (ISimpleThingy)rp.GetTransparentProxy(); mock.SetupResult("NonVirtualProperty", "foo"); --- 409,417 ---- } ! [Test] ! public void CallMethodOfImplementedInterface() { ! rp = new MockRealProxy(typeof (SimpleThingy), mock); ! ISimpleThingy thingy = (ISimpleThingy) rp.GetTransparentProxy(); mock.SetupResult("NonVirtualProperty", "foo"); *************** *** 335,342 **** } ! [Test] public void CallMethodOfInheritedInterface() { ! rp = new MockRealProxy(typeof(IDerivedThingy), mock); ! thingy = (IThingy)rp.GetTransparentProxy(); mock.Expect("NoArgs"); --- 420,428 ---- } ! [Test] ! public void CallMethodOfInheritedInterface() { ! rp = new MockRealProxy(typeof (IDerivedThingy), mock); ! thingy = (IThingy) rp.GetTransparentProxy(); mock.Expect("NoArgs"); *************** *** 345,352 **** } ! [Test] public void CallMethodOfInheritedClass() { ! rp = new MockRealProxy(typeof(DerivedThing), mock); ! DerivedThing derived = (DerivedThing)rp.GetTransparentProxy(); mock.Expect("NoArgs"); --- 431,439 ---- } ! [Test] ! public void CallMethodOfInheritedClass() { ! rp = new MockRealProxy(typeof (DerivedThing), mock); ! DerivedThing derived = (DerivedThing) rp.GetTransparentProxy(); mock.Expect("NoArgs"); *************** *** 355,368 **** } ! [Test] public void CallReadOnlyProperty() { mock.ExpectAndReturn("ReadProperty", "hello"); mock.ExpectAndReturn("ReadProperty", "world"); ! Assertion.AssertEquals("hello", thingy.ReadProperty); ! Assertion.AssertEquals("world", thingy.ReadProperty); mock.Verify(); } ! [Test] public void WriteOnlyPropertyExpectations() { mock.Expect("WriteProperty", "hello"); --- 442,457 ---- } ! [Test] ! public void CallReadOnlyProperty() { mock.ExpectAndReturn("ReadProperty", "hello"); mock.ExpectAndReturn("ReadProperty", "world"); ! Assert.AreEqual("hello", thingy.ReadProperty); ! Assert.AreEqual("world", thingy.ReadProperty); mock.Verify(); } ! [Test] ! public void WriteOnlyPropertyExpectations() { mock.Expect("WriteProperty", "hello"); *************** *** 373,377 **** } ! [Test] public void ReadAndWriteProperty() { mock.Expect("AProperty", "hello"); --- 462,467 ---- } ! [Test] ! public void ReadAndWriteProperty() { mock.Expect("AProperty", "hello"); *************** *** 381,393 **** thingy.AProperty = "hello"; thingy.AProperty = "world"; ! Assertion.AssertEquals("good", thingy.AProperty); ! Assertion.AssertEquals("bye", thingy.AProperty); mock.Verify(); } ! [Test] public void CanProxyAbstractClass() { ! rp = new MockRealProxy(typeof(AbstractThingy), mock); ! AbstractThingy s = (AbstractThingy)rp.GetTransparentProxy(); mock.ExpectAndReturn("VirtualMethod", "hello"); --- 471,484 ---- thingy.AProperty = "hello"; thingy.AProperty = "world"; ! Assert.AreEqual("good", thingy.AProperty); ! Assert.AreEqual("bye", thingy.AProperty); mock.Verify(); } ! [Test] ! public void CanProxyAbstractClass() { ! rp = new MockRealProxy(typeof (AbstractThingy), mock); ! AbstractThingy s = (AbstractThingy) rp.GetTransparentProxy(); mock.ExpectAndReturn("VirtualMethod", "hello"); *************** *** 396,411 **** mock.ExpectAndReturn("ProtectedInternalMethod", "white"); ! Assertion.AssertEquals("hello", s.VirtualMethod()); ! Assertion.AssertEquals(123, s.GetHashCode()); ! Assertion.AssertEquals("fish", s.AbstractMethod()); ! Assertion.AssertEquals("white", s.ProtectedInternalMethod()); mock.Verify(); } ! [Test] public void CanProxyConcreteClass() { ! rp = new MockRealProxy(typeof(ConcreteThing), mock); ! ConcreteThing concrete = (ConcreteThing)rp.GetTransparentProxy(); mock.Expect("NoArgs"); --- 487,503 ---- mock.ExpectAndReturn("ProtectedInternalMethod", "white"); ! Assert.AreEqual("hello", s.VirtualMethod()); ! Assert.AreEqual(123, s.GetHashCode()); ! Assert.AreEqual("fish", s.AbstractMethod()); ! Assert.AreEqual("white", s.ProtectedInternalMethod()); mock.Verify(); } ! [Test] ! public void CanProxyConcreteClass() { ! rp = new MockRealProxy(typeof (ConcreteThing), mock); ! ConcreteThing concrete = (ConcreteThing) rp.GetTransparentProxy(); mock.Expect("NoArgs"); *************** *** 414,434 **** } ! [Test] public void CanHandleNonVirtualFeatures() { ! rp = new MockRealProxy(typeof(AbstractThingy), mock); ! AbstractThingy s = (AbstractThingy)rp.GetTransparentProxy(); mock.SetupResult("NonVirtualMethod", "non virtual method"); mock.SetupResult("NonVirtualProperty", "non virtual property"); ! Assertion.AssertEquals("non virtual method", s.NonVirtualMethod()); ! Assertion.AssertEquals("non virtual property", s.NonVirtualProperty); mock.Verify(); } ! [Test] public void CanHandleObjectMethodOnInterface() { ! Assertion.AssertNull(thingy.ToString()); } } ! } --- 506,528 ---- } ! [Test] ! public void CanHandleNonVirtualFeatures() { ! rp = new MockRealProxy(typeof (AbstractThingy), mock); ! AbstractThingy s = (AbstractThingy) rp.GetTransparentProxy(); mock.SetupResult("NonVirtualMethod", "non virtual method"); mock.SetupResult("NonVirtualProperty", "non virtual property"); ! Assert.AreEqual("non virtual method", s.NonVirtualMethod()); ! Assert.AreEqual("non virtual property", s.NonVirtualProperty); mock.Verify(); } ! [Test] ! public void CanHandleObjectMethodOnInterface() { ! Assert.IsNull(thingy.ToString()); } } ! } \ No newline at end of file |
|
From: Owen R. <exo...@us...> - 2004-10-22 11:47:09
|
Update of /cvsroot/nmock/nmock/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19470/test Modified Files: test.csproj Log Message: upgraded to nunit 2.2 upgraded to new version of NAnt Index: test.csproj =================================================================== RCS file: /cvsroot/nmock/nmock/test/test.csproj,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** test.csproj 13 Oct 2004 15:43:15 -0000 1.12 --- test.csproj 22 Oct 2004 11:46:28 -0000 1.13 *************** *** 145,148 **** --- 145,153 ---- /> <File + RelPath = "NMock\Constraints\IsArrayEqualTest.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "NMock\Dynamic\ClassGeneratorTest.cs" SubType = "Code" |
|
From: Owen R. <exo...@us...> - 2004-10-22 11:47:09
|
Update of /cvsroot/nmock/nmock/test/NMock/Dynamic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19470/test/NMock/Dynamic Modified Files: ClassGeneratorTest.cs InterfaceListerTest.cs Log Message: upgraded to nunit 2.2 upgraded to new version of NAnt Index: ClassGeneratorTest.cs =================================================================== RCS file: /cvsroot/nmock/nmock/test/NMock/Dynamic/ClassGeneratorTest.cs,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ClassGeneratorTest.cs 23 Jun 2004 04:44:53 -0000 1.17 --- ClassGeneratorTest.cs 22 Oct 2004 11:46:27 -0000 1.18 *************** *** 1,16 **** using System; using System.Collections; using System.Reflection; using System.Reflection.Emit; - - - using NUnit.Framework; - using NMock; using NMock.Constraints; namespace NMock.Dynamic { #region types ! public interface IThingy { void NoArgs(); --- 1,16 ---- using System; using System.Collections; + using System.IO; using System.Reflection; using System.Reflection.Emit; using NMock.Constraints; + using NUnit.Framework; namespace NMock.Dynamic { + #region types ! ! public interface IThingy { void NoArgs(); *************** *** 37,55 **** string AProperty { get; set; } } ! ! public struct MyStruct ! { ! public int x; ! } ! ! class X ! { ! private IMock mock = null; ! ! string stringReturn() { return (string)mock.Invoke("stringReturn", new object[0]); } ! decimal decimalReturn() { return (decimal)mock.Invoke("decimalReturn", new object[0]); } ! MyStruct structReturn() { return (MyStruct)mock.Invoke("structReturn", new object[0]); } ! } ! public interface ISolidThingy { --- 37,66 ---- string AProperty { get; set; } } ! ! public struct MyStruct ! { ! public int x; ! } ! ! internal class X ! { ! private IMock mock = null; ! ! private string stringReturn() ! { ! return (string) mock.Invoke("stringReturn", new object[0]); ! } ! ! private decimal decimalReturn() ! { ! return (decimal) mock.Invoke("decimalReturn", new object[0]); ! } ! ! private MyStruct structReturn() ! { ! return (MyStruct) mock.Invoke("structReturn", new object[0]); ! } ! } ! public interface ISolidThingy { *************** *** 60,75 **** { // internal and protected internal methods must be overridable! ! public virtual string VirtualMethod() { return "xx"; } public abstract string AbstractMethod(); ! protected internal virtual string ProtectedInternalMethod() { return "xx"; } // cannot override ! public static string StaticMethod() { return "xx"; } ! public string NonVirtualMethod() { return "xx"; } ! internal string NonVirtualInternalMethod() { return "xx"; } ! private string privateMethod() { return "xx"; } ! protected virtual string protectedMethod() { return "xx"; } ! string defaultInternalMethod() { return "xx"; } ! public override string ToString() { return "xx"; } // method is ignored // implemented interface members/methods are defined as final (ie. non-virtual) --- 71,121 ---- { // internal and protected internal methods must be overridable! ! public virtual string VirtualMethod() ! { ! return "xx"; ! } ! public abstract string AbstractMethod(); ! ! protected internal virtual string ProtectedInternalMethod() ! { ! return "xx"; ! } // cannot override ! public static string StaticMethod() ! { ! return "xx"; ! } ! ! public string NonVirtualMethod() ! { ! return "xx"; ! } ! ! internal string NonVirtualInternalMethod() ! { ! return "xx"; ! } ! ! private string privateMethod() ! { ! return "xx"; ! } ! ! protected virtual string protectedMethod() ! { ! return "xx"; ! } ! ! private string defaultInternalMethod() ! { ! return "xx"; ! } ! ! public override string ToString() ! { ! return "xx"; ! } // method is ignored // implemented interface members/methods are defined as final (ie. non-virtual) *************** *** 80,109 **** } ! public class ClassWithInternalMethod { ! internal virtual string InternalMethod() { return "xx"; } } ! public enum MyEnum { ! A, B, C, D } ! public class ConcreteThing { ! public virtual void NoArgs() { Assertion.Fail("Should have been overriden"); } } #endregion ! [TestFixture] public class ClassGeneratorInvocationHandlerTest { ! public class InvocationHandlerImpl : IInvocationHandler { public string expectedMethodName; public bool wasCalled = false; ! public object Invoke(string methodName, params object[] args) { ! Assertion.AssertEquals("should be method name", expectedMethodName, methodName); ! Assertion.AssertEquals("Should be no args", 0, args.Length); wasCalled = true; return null; --- 126,167 ---- } ! public class ClassWithInternalMethod { ! internal virtual string InternalMethod() ! { ! return "xx"; ! } } ! public enum MyEnum { ! A, ! B, ! C, ! D } ! ! public class ConcreteThing { ! public virtual void NoArgs() ! { ! Assert.Fail("Should have been overriden"); ! } } + #endregion ! [TestFixture] ! public class ClassGeneratorInvocationHandlerTest { ! public class InvocationHandlerImpl : IInvocationHandler { public string expectedMethodName; public bool wasCalled = false; ! public object Invoke(string methodName, params object[] args) { ! Assert.AreEqual(expectedMethodName, methodName, "should be method name"); ! Assert.AreEqual(0, args.Length, "Should be no args"); wasCalled = true; return null; *************** *** 111,142 **** } ! [Test] public void CreateGenericProxy() { InvocationHandlerImpl handler = new InvocationHandlerImpl(); ! ClassGenerator cg = new ClassGenerator(typeof(IThingy), handler); ! IThingy thingy = (IThingy)cg.Generate(); ! handler.expectedMethodName = "NoArgs"; thingy.NoArgs(); ! Assertion.Assert("Should have been called ", handler.wasCalled); } } ! [TestFixture] public class ClassGeneratorTest { private ClassGenerator cg; private IMock mock; private IThingy thingy; ! ! [SetUp] public void SetUp() { mock = new Mock("Test Mock"); ! cg = new ClassGenerator(typeof(IThingy), mock); ! thingy = (IThingy)cg.Generate(); } ! [Test] public void CallMethodIsCalled() { mock.Expect("NoArgs"); --- 169,204 ---- } ! [Test] ! public void CreateGenericProxy() { InvocationHandlerImpl handler = new InvocationHandlerImpl(); ! ClassGenerator cg = new ClassGenerator(typeof (IThingy), handler); ! IThingy thingy = (IThingy) cg.Generate(); ! handler.expectedMethodName = "NoArgs"; thingy.NoArgs(); ! Assert.IsTrue(handler.wasCalled, "Should have been called "); } } ! [TestFixture] ! public class ClassGeneratorTest { private ClassGenerator cg; private IMock mock; private IThingy thingy; ! ! [SetUp] ! public void SetUp() { mock = new Mock("Test Mock"); ! cg = new ClassGenerator(typeof (IThingy), mock); ! thingy = (IThingy) cg.Generate(); } ! [Test] ! public void CallMethodIsCalled() { mock.Expect("NoArgs"); *************** *** 145,228 **** } ! [Test] public void CallMethodWithReturn() { object x = "sdfs"; mock.ExpectAndReturn("simpleReturn", x); object result = thingy.simpleReturn(); ! Assertion.AssertEquals(x, result); mock.Verify(); } ! [Test] public void CallMethodWithReturnAndCast() { string x = "sdfs"; mock.ExpectAndReturn("stringReturn", x); string result = thingy.stringReturn(); ! Assertion.AssertEquals(x, result); mock.Verify(); } ! [Test] public void CallMethodWithWeirdObjectReturn() { IThingy t = thingy; mock.ExpectAndReturn("AThingy", t); IThingy result = thingy.AThingy(); ! Assertion.AssertEquals(thingy, result); mock.Verify(); } ! [Test] public void CallMethodWithReturnInt() { mock.ExpectAndReturn("intReturn", 7); int result = thingy.intReturn(); ! Assertion.AssertEquals(7, result); mock.Verify(); } ! [Test] public void CallMethodWithReturnBoxings() { mock.ExpectAndReturn("boolReturn", true); mock.ExpectAndReturn("doubleReturn", 1234567891234E+10); ! Assertion.Assert(thingy.boolReturn()); ! Assertion.AssertEquals(1234567891234E+10, thingy.doubleReturn()); mock.Verify(); } ! [Test] ! public void CallMethodWithReturnDecimal() ! { ! decimal d = new decimal(3); ! mock.ExpectAndReturn("decimalReturn", d); ! decimal result = thingy.decimalReturn(); ! Assertion.AssertEquals(new decimal(3), result); ! mock.Verify(); ! } ! ! [Test] ! public void CallMethodWithStruct() ! { ! MyStruct str = new MyStruct(); ! str.x = 3; ! mock.ExpectAndReturn("structReturn", str); ! MyStruct result = thingy.structReturn(); ! Assertion.AssertEquals(str, result); ! mock.Verify(); ! } ! ! [Test] public void CallMethodWithReturnEnum() { mock.ExpectAndReturn("getEnum", MyEnum.C); MyEnum result = thingy.getEnum(); ! Assertion.AssertEquals(MyEnum.C, result); mock.Verify(); } ! ! [Test] [ExpectedException(typeof(System.IO.IOException))] public void CallMethodTheThrowsException() { ! mock.ExpectAndThrow("boolReturn", new System.IO.IOException()); thingy.boolReturn(); } ! [Test] public void CallMethodWithStringParameterExpectation() { mock.Expect("WithSimpleArg", new StartsWith("he")); --- 207,298 ---- } ! [Test] ! public void CallMethodWithReturn() { object x = "sdfs"; mock.ExpectAndReturn("simpleReturn", x); object result = thingy.simpleReturn(); ! Assert.AreEqual(x, result); mock.Verify(); } ! [Test] ! public void CallMethodWithReturnAndCast() { string x = "sdfs"; mock.ExpectAndReturn("stringReturn", x); string result = thingy.stringReturn(); ! Assert.AreEqual(x, result); mock.Verify(); } ! [Test] ! public void CallMethodWithWeirdObjectReturn() { IThingy t = thingy; mock.ExpectAndReturn("AThingy", t); IThingy result = thingy.AThingy(); ! Assert.AreEqual(thingy, result); mock.Verify(); } ! [Test] ! public void CallMethodWithReturnInt() { mock.ExpectAndReturn("intReturn", 7); int result = thingy.intReturn(); ! Assert.AreEqual(7, result); mock.Verify(); } ! [Test] ! public void CallMethodWithReturnBoxings() { mock.ExpectAndReturn("boolReturn", true); mock.ExpectAndReturn("doubleReturn", 1234567891234E+10); ! Assert.IsTrue(thingy.boolReturn()); ! Assert.AreEqual(1234567891234E+10, thingy.doubleReturn()); mock.Verify(); } ! [Test] ! public void CallMethodWithReturnDecimal() ! { ! decimal d = new decimal(3); ! mock.ExpectAndReturn("decimalReturn", d); ! decimal result = thingy.decimalReturn(); ! Assert.AreEqual(new decimal(3), result); ! mock.Verify(); ! } ! ! [Test] ! public void CallMethodWithStruct() ! { ! MyStruct str = new MyStruct(); ! str.x = 3; ! mock.ExpectAndReturn("structReturn", str); ! MyStruct result = thingy.structReturn(); ! Assert.AreEqual(str, result); ! mock.Verify(); ! } ! ! [Test] ! public void CallMethodWithReturnEnum() { mock.ExpectAndReturn("getEnum", MyEnum.C); MyEnum result = thingy.getEnum(); ! Assert.AreEqual(MyEnum.C, result); mock.Verify(); } ! ! [Test, ExpectedException(typeof (IOException))] ! public void CallMethodTheThrowsException() { ! mock.ExpectAndThrow("boolReturn", new IOException()); thingy.boolReturn(); } ! [Test] ! public void CallMethodWithStringParameterExpectation() { mock.Expect("WithSimpleArg", new StartsWith("he")); *************** *** 230,235 **** mock.Verify(); } ! ! [Test] public void CallMethodWithStringParameter() { mock.Expect("WithSimpleArg", "hello"); --- 300,306 ---- mock.Verify(); } ! ! [Test] ! public void CallMethodWithStringParameter() { mock.Expect("WithSimpleArg", "hello"); *************** *** 238,248 **** } ! [Test] public void CallMethodWithIntParameter() { mock.Expect("WithIntParam", 1); thingy.WithIntParam(1); mock.Verify(); ! } ! [Test] [ExpectedException(typeof(VerifyException))] public void CallMethodWithParamExpectationsThatFails() { mock.Expect("WithSimpleArg", new IsEqual("hello")); --- 309,322 ---- } ! [Test] ! public void CallMethodWithIntParameter() { mock.Expect("WithIntParam", 1); thingy.WithIntParam(1); mock.Verify(); ! } ! ! [Test, ExpectedException(typeof (VerifyException))] ! public void CallMethodWithParamExpectationsThatFails() { mock.Expect("WithSimpleArg", new IsEqual("hello")); *************** *** 250,255 **** mock.Verify(); } ! ! [Test] public void CallMethodWithTwoParamExpectations() { mock.Expect("WithTwoArgs", new IsEqual("hello"), new IsEqual("world")); --- 324,330 ---- mock.Verify(); } ! ! [Test] ! public void CallMethodWithTwoParamExpectations() { mock.Expect("WithTwoArgs", new IsEqual("hello"), new IsEqual("world")); *************** *** 257,262 **** mock.Verify(); } ! ! [Test] [ExpectedException(typeof(VerifyException))] public void CallMethodWithTwoParamExpectationsThatFails() { mock.Expect("WithTwoArgs", new IsEqual("hello"), new IsEqual("world")); --- 332,338 ---- mock.Verify(); } ! ! [Test, ExpectedException(typeof (VerifyException))] ! public void CallMethodWithTwoParamExpectationsThatFails() { mock.Expect("WithTwoArgs", new IsEqual("hello"), new IsEqual("world")); *************** *** 264,269 **** mock.Verify(); } ! ! [Test] public void CallMethodWithThreeParamExpectations() { mock.Expect("WithThreeArgs", new IsEqual("hello"), new IsEqual("the"), new IsEqual("world")); --- 340,346 ---- mock.Verify(); } ! ! [Test] ! public void CallMethodWithThreeParamExpectations() { mock.Expect("WithThreeArgs", new IsEqual("hello"), new IsEqual("the"), new IsEqual("world")); *************** *** 271,276 **** mock.Verify(); } ! ! [Test] public void CallMethodWithLotsOfArgsExpectations() { mock.Expect("WithLotsOfArgs", new IsEqual("hello"), new IsEqual("world"), new IsEqual("is"), new IsEqual("this"), new IsEqual("the"), new IsEqual("end")); --- 348,354 ---- mock.Verify(); } ! ! [Test] ! public void CallMethodWithLotsOfArgsExpectations() { mock.Expect("WithLotsOfArgs", new IsEqual("hello"), new IsEqual("world"), new IsEqual("is"), new IsEqual("this"), new IsEqual("the"), new IsEqual("end")); *************** *** 279,283 **** } ! [Test] public void CallMethodWithOtherArgs() { IList l = new ArrayList(); --- 357,362 ---- } ! [Test] ! public void CallMethodWithOtherArgs() { IList l = new ArrayList(); *************** *** 286,296 **** mock.Verify(); } ! [Test] public void CallMethodWithVariableNumberOfParams() { ! mock.Expect("WithParams", 1, new object[]{"string1", "string2"}); thingy.WithParams(1, "string1", "string2"); mock.Verify(); } ! [Test] public void CallMethodWithLongParam() { mock.Expect("WithLongParam", 5L); --- 365,379 ---- mock.Verify(); } ! ! [Test] ! public void CallMethodWithVariableNumberOfParams() { ! mock.Expect("WithParams", 1, new object[] {"string1", "string2"}); thingy.WithParams(1, "string1", "string2"); mock.Verify(); } ! ! [Test] ! public void CallMethodWithLongParam() { mock.Expect("WithLongParam", 5L); *************** *** 299,312 **** } ! [Test] public void CallReadOnlyProperty() { mock.ExpectAndReturn("ReadProperty", "hello"); mock.ExpectAndReturn("ReadProperty", "world"); ! Assertion.AssertEquals("hello", thingy.ReadProperty); ! Assertion.AssertEquals("world", thingy.ReadProperty); mock.Verify(); } ! [Test] public void WriteOnlyPropertyExpectations() { mock.Expect("WriteProperty", "hello"); --- 382,397 ---- } ! [Test] ! public void CallReadOnlyProperty() { mock.ExpectAndReturn("ReadProperty", "hello"); mock.ExpectAndReturn("ReadProperty", "world"); ! Assert.AreEqual("hello", thingy.ReadProperty); ! Assert.AreEqual("world", thingy.ReadProperty); mock.Verify(); } ! [Test] ! public void WriteOnlyPropertyExpectations() { mock.Expect("WriteProperty", "hello"); *************** *** 317,321 **** } ! [Test] public void ReadAndWriteProperty() { mock.Expect("AProperty", "hello"); --- 402,407 ---- } ! [Test] ! public void ReadAndWriteProperty() { mock.Expect("AProperty", "hello"); *************** *** 325,337 **** thingy.AProperty = "hello"; thingy.AProperty = "world"; ! Assertion.AssertEquals("good", thingy.AProperty); ! Assertion.AssertEquals("bye", thingy.AProperty); mock.Verify(); } ! [Test] public void CanExtendAbstractClass() { ! cg = new ClassGenerator(typeof(AbstractThingy), mock); ! AbstractThingy s = (AbstractThingy)cg.Generate(); mock.ExpectAndReturn("VirtualMethod", "hello"); --- 411,424 ---- thingy.AProperty = "hello"; thingy.AProperty = "world"; ! Assert.AreEqual("good", thingy.AProperty); ! Assert.AreEqual("bye", thingy.AProperty); mock.Verify(); } ! [Test] ! public void CanExtendAbstractClass() { ! cg = new ClassGenerator(typeof (AbstractThingy), mock); ! AbstractThingy s = (AbstractThingy) cg.Generate(); mock.ExpectAndReturn("VirtualMethod", "hello"); *************** *** 340,371 **** mock.ExpectAndReturn("ProtectedInternalMethod", "white"); ! Assertion.AssertEquals("hello", s.VirtualMethod()); ! Assertion.AssertEquals(123, s.GetHashCode()); ! Assertion.AssertEquals("fish", s.AbstractMethod()); ! Assertion.AssertEquals("white", s.ProtectedInternalMethod()); mock.Verify(); } ! ! [Test] public void CheckBoxingOpCodes() { BoxingOpCodes opCodes = new BoxingOpCodes(); ! Assertion.AssertEquals( OpCodes.Ldind_I1, opCodes[typeof(sbyte)] ); ! Assertion.AssertEquals( OpCodes.Ldind_I2, opCodes[typeof(short)] ); ! Assertion.AssertEquals( OpCodes.Ldind_I4, opCodes[typeof(int)] ); ! Assertion.AssertEquals( OpCodes.Ldind_I8, opCodes[typeof(long)] ); ! Assertion.AssertEquals( OpCodes.Ldind_U1, opCodes[typeof(byte)] ); ! Assertion.AssertEquals( OpCodes.Ldind_U2, opCodes[typeof(ushort)] ); ! Assertion.AssertEquals( OpCodes.Ldind_U4, opCodes[typeof(uint)] ); ! Assertion.AssertEquals( OpCodes.Ldind_I8, opCodes[typeof(ulong)] ); ! Assertion.AssertEquals( OpCodes.Ldind_R4, opCodes[typeof(float)] ); ! Assertion.AssertEquals( OpCodes.Ldind_R8, opCodes[typeof(double)] ); ! Assertion.AssertEquals( OpCodes.Ldind_U2, opCodes[typeof(char)] ); ! Assertion.AssertEquals( OpCodes.Ldind_I1, opCodes[typeof(bool)] ); } ! [Test] public void CanExtendConcreteClass() { ! ConcreteThing concrete = (ConcreteThing)(new ClassGenerator(typeof(ConcreteThing), mock)).Generate(); mock.Expect("NoArgs"); --- 427,461 ---- mock.ExpectAndReturn("ProtectedInternalMethod", "white"); ! Assert.AreEqual("hello", s.VirtualMethod()); ! Assert.AreEqual(123, s.GetHashCode()); ! Assert.AreEqual("fish", s.AbstractMethod()); ! Assert.AreEqual("white", s.ProtectedInternalMethod()); mock.Verify(); } ! ! [Test] ! public void CheckBoxingOpCodes() { BoxingOpCodes opCodes = new BoxingOpCodes(); ! Assert.AreEqual(OpCodes.Ldind_I1, opCodes[typeof (sbyte)]); ! Assert.AreEqual(OpCodes.Ldind_I2, opCodes[typeof (short)]); ! Assert.AreEqual(OpCodes.Ldind_I4, opCodes[typeof (int)]); ! Assert.AreEqual(OpCodes.Ldind_I8, opCodes[typeof (long)]); ! Assert.AreEqual(OpCodes.Ldind_U1, opCodes[typeof (byte)]); ! Assert.AreEqual(OpCodes.Ldind_U2, opCodes[typeof (ushort)]); ! Assert.AreEqual(OpCodes.Ldind_U4, opCodes[typeof (uint)]); ! Assert.AreEqual(OpCodes.Ldind_I8, opCodes[typeof (ulong)]); ! Assert.AreEqual(OpCodes.Ldind_R4, opCodes[typeof (float)]); ! Assert.AreEqual(OpCodes.Ldind_R8, opCodes[typeof (double)]); ! Assert.AreEqual(OpCodes.Ldind_U2, opCodes[typeof (char)]); ! Assert.AreEqual(OpCodes.Ldind_I1, opCodes[typeof (bool)]); } ! ! [Test] ! public void CanExtendConcreteClass() { ! ConcreteThing concrete = (ConcreteThing) (new ClassGenerator(typeof (ConcreteThing), mock)).Generate(); mock.Expect("NoArgs"); *************** *** 375,417 **** // Limitations ! [Test] public void CannotOverrideNonVirtualFeatures() { ! cg = new ClassGenerator(typeof(AbstractThingy), mock); ! AbstractThingy s = (AbstractThingy)cg.Generate(); mock.SetupResult("NonVirtualMethod", "non virtual method"); mock.SetupResult("NonVirtualProperty", "non virtual property"); ! Assertion.AssertEquals("xx", s.NonVirtualMethod()); ! Assertion.AssertEquals("xx", s.NonVirtualProperty); mock.Verify(); } ! [Test] public void DoesNotOverrideToString() { ! cg = new ClassGenerator(typeof(AbstractThingy), mock); ! AbstractThingy s = (AbstractThingy)cg.Generate(); mock.SetupResult("ToString", "to string"); ! Assertion.AssertEquals("xx", s.ToString()); mock.Verify(); } ! [Test] public void IgnoresInternalMethodsBecauseOfAssemblyVisibility() { ArrayList methodsToIgnore = new ArrayList(); ! new ClassGenerator(typeof(ClassWithInternalMethod), mock, methodsToIgnore).Generate(); ! Assertion.Assert("Should include InternalMethod", methodsToIgnore.Contains("InternalMethod")); } ! ! [Test] public void OnlyOneAssemblyIsCreated() { ! cg = new ClassGenerator(typeof(IThingy), mock); cg.Generate(); int originalAssemblyCount = AppDomain.CurrentDomain.GetAssemblies().Length; ! cg = new ClassGenerator(typeof(ConcreteThing), mock); cg.Generate(); --- 465,511 ---- // Limitations ! [Test] ! public void CannotOverrideNonVirtualFeatures() { ! cg = new ClassGenerator(typeof (AbstractThingy), mock); ! AbstractThingy s = (AbstractThingy) cg.Generate(); mock.SetupResult("NonVirtualMethod", "non virtual method"); mock.SetupResult("NonVirtualProperty", "non virtual property"); ! Assert.AreEqual("xx", s.NonVirtualMethod()); ! Assert.AreEqual("xx", s.NonVirtualProperty); mock.Verify(); } ! [Test] ! public void DoesNotOverrideToString() { ! cg = new ClassGenerator(typeof (AbstractThingy), mock); ! AbstractThingy s = (AbstractThingy) cg.Generate(); mock.SetupResult("ToString", "to string"); ! Assert.AreEqual("xx", s.ToString()); mock.Verify(); } ! [Test] ! public void IgnoresInternalMethodsBecauseOfAssemblyVisibility() { ArrayList methodsToIgnore = new ArrayList(); ! new ClassGenerator(typeof (ClassWithInternalMethod), mock, methodsToIgnore).Generate(); ! Assert.IsTrue(methodsToIgnore.Contains("InternalMethod"), "Should include InternalMethod"); } ! ! [Test] ! public void OnlyOneAssemblyIsCreated() { ! cg = new ClassGenerator(typeof (IThingy), mock); cg.Generate(); int originalAssemblyCount = AppDomain.CurrentDomain.GetAssemblies().Length; ! cg = new ClassGenerator(typeof (ConcreteThing), mock); cg.Generate(); *************** *** 419,432 **** } ! [Test] public void MockTypesAreReused() { ! cg = new ClassGenerator(typeof(Exception), mock); cg.Generate(); Assembly mockAssembly = null; ! foreach(Assembly ass in AppDomain.CurrentDomain.GetAssemblies()) { ! if(ass.GetName().Name == "DynamicProxyAssembly") { mockAssembly = ass; --- 513,527 ---- } ! [Test] ! public void MockTypesAreReused() { ! cg = new ClassGenerator(typeof (Exception), mock); cg.Generate(); Assembly mockAssembly = null; ! foreach (Assembly ass in AppDomain.CurrentDomain.GetAssemblies()) { ! if (ass.GetName().Name == "DynamicProxyAssembly") { mockAssembly = ass; *************** *** 438,442 **** int originalTypeCount = mockAssembly.GetTypes().Length; ! cg = new ClassGenerator(typeof(Exception), mock); cg.Generate(); --- 533,537 ---- int originalTypeCount = mockAssembly.GetTypes().Length; ! cg = new ClassGenerator(typeof (Exception), mock); cg.Generate(); *************** *** 444,446 **** } } ! } --- 539,541 ---- } } ! } \ No newline at end of file Index: InterfaceListerTest.cs =================================================================== RCS file: /cvsroot/nmock/nmock/test/NMock/Dynamic/InterfaceListerTest.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** InterfaceListerTest.cs 1 Jun 2003 09:48:50 -0000 1.1 --- InterfaceListerTest.cs 22 Oct 2004 11:46:27 -0000 1.2 *************** *** 174,178 **** actualString.Append(","); } ! Assertion.AssertEquals(expectedString.ToString(), actualString.ToString()); } --- 174,178 ---- actualString.Append(","); } ! Assert.AreEqual(expectedString.ToString(), actualString.ToString()); } |
|
From: Owen R. <exo...@us...> - 2004-10-22 11:47:08
|
Update of /cvsroot/nmock/nmock/test/NMock/Remoting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19470/test/NMock/Remoting Modified Files: RemotingMockTest.cs Log Message: upgraded to nunit 2.2 upgraded to new version of NAnt Index: RemotingMockTest.cs =================================================================== RCS file: /cvsroot/nmock/nmock/test/NMock/Remoting/RemotingMockTest.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RemotingMockTest.cs 13 Jul 2003 13:27:07 -0000 1.1 --- RemotingMockTest.cs 22 Oct 2004 11:46:28 -0000 1.2 *************** *** 6,10 **** { [TestFixture] ! public class RemotingMockTest : Assertion { [Test] --- 6,10 ---- { [TestFixture] ! public class RemotingMockTest { [Test] *************** *** 13,17 **** RemotingMock mock = new RemotingMock(typeof(Base)); MarshalByRefObject instance = mock.MarshalByRefInstance; ! AssertNotNull(instance); } --- 13,17 ---- RemotingMock mock = new RemotingMock(typeof(Base)); MarshalByRefObject instance = mock.MarshalByRefInstance; ! Assert.IsNotNull(instance); } |
|
From: Owen R. <exo...@us...> - 2004-10-22 11:47:07
|
Update of /cvsroot/nmock/nmock/sample/random In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19470/sample/random Modified Files: WeatherTest.cs Log Message: upgraded to nunit 2.2 upgraded to new version of NAnt Index: WeatherTest.cs =================================================================== RCS file: /cvsroot/nmock/nmock/sample/random/WeatherTest.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** WeatherTest.cs 15 Nov 2002 22:31:10 -0000 1.2 --- WeatherTest.cs 22 Oct 2004 11:46:26 -0000 1.3 *************** *** 1,58 **** - using NUnit.Framework; using NMock; ! namespace NMockSample.Random { - [TestFixture] public class WeatherTest { - private IMock random; private Weather weather; ! [SetUp] ! public void SetUp() { ! random = new DynamicMock(typeof(WeatherRandom)); ! weather = new Weather((WeatherRandom)random.MockInstance); } ! ! [Test] ! public void RandomRaining() { random.SetupResult("NextTemperature", 1.0); random.SetupResult("NextIsRaining", true); weather.Randomize(); ! Assertion.Assert("is raining", weather.IsRaining); } ! ! [Test] ! public void RandomNotRaining() { random.SetupResult("NextTemperature", 1.0); random.SetupResult("NextIsRaining", false); weather.Randomize(); ! Assertion.Assert("is not raining", !weather.IsRaining); } ! [Test] ! public void RandomTemperatureSunny() ! { double TEMPERATURE = 20.0; random.SetupResult("NextTemperature", TEMPERATURE); random.SetupResult("NextIsRaining", false); weather.Randomize(); ! Assertion.AssertEquals("temperature", TEMPERATURE, weather.Temperature); } [Test] ! public void RandomTemperatureRaining() ! { double TEMPERATURE = 20.0; random.SetupResult("NextTemperature", TEMPERATURE); random.SetupResult("NextIsRaining", true); weather.Randomize(); ! Assertion.AssertEquals("temperature", TEMPERATURE / 2.0, weather.Temperature); } --- 1,56 ---- using NMock; + using NUnit.Framework; ! namespace NMockSample.Random { [TestFixture] public class WeatherTest { private IMock random; private Weather weather; ! [SetUp] ! public void SetUp() { ! random = new DynamicMock(typeof (WeatherRandom)); ! weather = new Weather((WeatherRandom) random.MockInstance); } ! ! [Test] ! public void RandomRaining() { random.SetupResult("NextTemperature", 1.0); random.SetupResult("NextIsRaining", true); weather.Randomize(); ! Assert.IsTrue(weather.IsRaining, "is raining"); } ! ! [Test] ! public void RandomNotRaining() { random.SetupResult("NextTemperature", 1.0); random.SetupResult("NextIsRaining", false); weather.Randomize(); ! Assert.IsTrue(!weather.IsRaining, "is not raining"); } ! [Test] ! public void RandomTemperatureSunny() ! { double TEMPERATURE = 20.0; random.SetupResult("NextTemperature", TEMPERATURE); random.SetupResult("NextIsRaining", false); weather.Randomize(); ! Assert.AreEqual(TEMPERATURE, weather.Temperature, "temperature"); } [Test] ! public void RandomTemperatureRaining() ! { double TEMPERATURE = 20.0; random.SetupResult("NextTemperature", TEMPERATURE); random.SetupResult("NextIsRaining", true); weather.Randomize(); ! Assert.AreEqual(TEMPERATURE/2.0, weather.Temperature, "temperature"); } *************** *** 62,107 **** public class DefaultWeatherRandomTest { - [Test] public void NextIsRaining() { ! IMock random = new DynamicMock(typeof(System.Random)); ! WeatherRandom weather = new DefaultWeatherRandom((System.Random)random.MockInstance); ! random.SetupResult("NextDouble", 0.0); ! Assertion.Assert("is raining", weather.NextIsRaining()); ! random.SetupResult("NextDouble", DefaultWeatherRandom.CHANCE_OF_RAIN); ! Assertion.Assert("is not raining", !weather.NextIsRaining()); ! random.SetupResult("NextDouble", 1.0); ! Assertion.Assert("is not raining", !weather.NextIsRaining()); } ! [Test] public void NextTemperature() { ! IMock random = new DynamicMock(typeof(System.Random)); ! WeatherRandom weather = new DefaultWeatherRandom((System.Random)random.MockInstance); ! random.SetupResult("NextDouble", 0.0); ! Assertion.AssertEquals("should be min temperature", DefaultWeatherRandom.MIN_TEMPERATURE, ! weather.NextTemperature() ! ); ! random.SetupResult("NextDouble", 0.5); ! Assertion.AssertEquals("should be average temperature", ! 0.5 * (DefaultWeatherRandom.MIN_TEMPERATURE + DefaultWeatherRandom.MAX_TEMPERATURE), ! weather.NextTemperature() ! ); ! random.SetupResult("NextDouble", 1.0); ! Assertion.AssertEquals("should be max temperature", ! DefaultWeatherRandom.MAX_TEMPERATURE, ! weather.NextTemperature() ! ); } ! } ! } --- 60,104 ---- public class DefaultWeatherRandomTest { [Test] public void NextIsRaining() { ! IMock random = new DynamicMock(typeof (System.Random)); ! WeatherRandom weather = new DefaultWeatherRandom((System.Random) random.MockInstance); ! random.SetupResult("NextDouble", 0.0); ! Assert.IsTrue(weather.NextIsRaining(), "is raining"); ! random.SetupResult("NextDouble", DefaultWeatherRandom.CHANCE_OF_RAIN); ! Assert.IsTrue(!weather.NextIsRaining(), "is not raining"); ! random.SetupResult("NextDouble", 1.0); ! Assert.IsTrue(!weather.NextIsRaining(), "is not raining"); } ! [Test] public void NextTemperature() { ! IMock random = new DynamicMock(typeof (System.Random)); ! WeatherRandom weather = new DefaultWeatherRandom((System.Random) random.MockInstance); ! random.SetupResult("NextDouble", 0.0); ! Assert.AreEqual( DefaultWeatherRandom.MIN_TEMPERATURE, ! weather.NextTemperature(), "should be min temperature" ! ); ! random.SetupResult("NextDouble", 0.5); ! Assert.AreEqual( ! 0.5*(DefaultWeatherRandom.MIN_TEMPERATURE + DefaultWeatherRandom.MAX_TEMPERATURE), ! weather.NextTemperature(), "should be average temperature" ! ); ! random.SetupResult("NextDouble", 1.0); ! Assert.AreEqual( ! DefaultWeatherRandom.MAX_TEMPERATURE, ! weather.NextTemperature(), "should be max temperature" ! ); } ! } ! } \ No newline at end of file |
|
From: Owen R. <exo...@us...> - 2004-10-22 11:47:07
|
Update of /cvsroot/nmock/nmock/test/NMock/Constraints In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19470/test/NMock/Constraints Modified Files: ConstraintsTest.cs IsArrayEqualTest.cs Log Message: upgraded to nunit 2.2 upgraded to new version of NAnt Index: ConstraintsTest.cs =================================================================== RCS file: /cvsroot/nmock/nmock/test/NMock/Constraints/ConstraintsTest.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ConstraintsTest.cs 24 Jul 2003 23:09:05 -0000 1.6 --- ConstraintsTest.cs 22 Oct 2004 11:46:26 -0000 1.7 *************** *** 1,5 **** ! using NUnit.Framework; using System.Text.RegularExpressions; ! using System.Collections; namespace NMock.Constraints { --- 1,7 ---- ! using System; ! using System.IO; using System.Text.RegularExpressions; ! using NUnit.Framework; ! namespace NMock.Constraints { *************** *** 15,23 **** { c = new IsNull(); ! Assertion.Assert(c.Eval(null)); ! Assertion.Assert(!c.Eval(new object())); ! Assertion.Assert(!c.Eval(1)); ! Assertion.Assert(!c.Eval(true)); ! Assertion.Assert(!c.Eval(false)); } --- 17,25 ---- { c = new IsNull(); ! Assert.IsTrue(c.Eval(null)); ! Assert.IsTrue(!c.Eval(new object())); ! Assert.IsTrue(!c.Eval(1)); ! Assert.IsTrue(!c.Eval(true)); ! Assert.IsTrue(!c.Eval(false)); } *************** *** 26,31 **** { c = new NotNull(); ! Assertion.Assert(!c.Eval(null)); ! Assertion.Assert(c.Eval(new object())); } --- 28,33 ---- { c = new NotNull(); ! Assert.IsTrue(!c.Eval(null)); ! Assert.IsTrue(c.Eval(new object())); } *************** *** 36,50 **** object o2 = new object(); c = new IsEqual(o1); ! Assertion.Assert(c.Eval(o1)); ! Assertion.Assert(!c.Eval(o2)); ! Assertion.Assert(!c.Eval(null)); int i1 = 1; int i2 = 2; c = new IsEqual(i1); ! Assertion.Assert(c.Eval(i1)); ! Assertion.Assert(c.Eval(1)); ! Assertion.Assert(!c.Eval(i2)); ! Assertion.Assert(!c.Eval(2)); } --- 38,52 ---- object o2 = new object(); c = new IsEqual(o1); ! Assert.IsTrue(c.Eval(o1)); ! Assert.IsTrue(!c.Eval(o2)); ! Assert.IsTrue(!c.Eval(null)); int i1 = 1; int i2 = 2; c = new IsEqual(i1); ! Assert.IsTrue(c.Eval(i1)); ! Assert.IsTrue(c.Eval(1)); ! Assert.IsTrue(!c.Eval(i2)); ! Assert.IsTrue(!c.Eval(2)); } *************** *** 56,62 **** c = new IsEqual(new object[] { 1, 2, 3 }); ! Assertion.Assert("should be equal", c.Eval(o1)); ! Assertion.Assert("shouldn't be equal", !c.Eval(o2)); ! Assertion.Assert("it ain't null", !c.Eval(null)); } --- 58,64 ---- c = new IsEqual(new object[] { 1, 2, 3 }); ! Assert.IsTrue(c.Eval(o1), "should be equal"); ! Assert.IsTrue(!c.Eval(o2), "shouldn't be equal"); ! Assert.IsTrue(!c.Eval(null), "it ain't null" ); } *************** *** 67,81 **** object o2 = new object(); c = new NotEqual(o1); ! Assertion.Assert(!c.Eval(o1)); ! Assertion.Assert(c.Eval(o2)); ! Assertion.Assert(c.Eval(null)); int i1 = 1; int i2 = 2; c = new NotEqual(i1); ! Assertion.Assert(!c.Eval(i1)); ! Assertion.Assert(!c.Eval(1)); ! Assertion.Assert(c.Eval(i2)); ! Assertion.Assert(c.Eval(2)); } --- 69,83 ---- object o2 = new object(); c = new NotEqual(o1); ! Assert.IsTrue(!c.Eval(o1)); ! Assert.IsTrue(c.Eval(o2)); ! Assert.IsTrue(c.Eval(null)); int i1 = 1; int i2 = 2; c = new NotEqual(i1); ! Assert.IsTrue(!c.Eval(i1)); ! Assert.IsTrue(!c.Eval(1)); ! Assert.IsTrue(c.Eval(i2)); ! Assert.IsTrue(c.Eval(2)); } *************** *** 84,96 **** { c = new IsAnything(); ! Assertion.Assert(c.Eval(null)); ! Assertion.Assert(c.Eval(0)); ! Assertion.Assert(c.Eval(99)); ! Assertion.Assert(c.Eval(-2)); ! Assertion.Assert(c.Eval(true)); ! Assertion.Assert(c.Eval(false)); ! Assertion.Assert(c.Eval("")); ! Assertion.Assert(c.Eval("hello")); ! Assertion.Assert(c.Eval(new object())); } --- 86,98 ---- { c = new IsAnything(); ! Assert.IsTrue(c.Eval(null)); ! Assert.IsTrue(c.Eval(0)); ! Assert.IsTrue(c.Eval(99)); ! Assert.IsTrue(c.Eval(-2)); ! Assert.IsTrue(c.Eval(true)); ! Assert.IsTrue(c.Eval(false)); ! Assert.IsTrue(c.Eval("")); ! Assert.IsTrue(c.Eval("hello")); ! Assert.IsTrue(c.Eval(new object())); } *************** *** 98,105 **** public void IsType() { ! c = new IsTypeOf(typeof(System.IO.TextReader)); ! Assertion.Assert(!c.Eval(null)); ! Assertion.Assert(c.Eval(new System.IO.StringReader(""))); ! Assertion.Assert(!c.Eval(new System.IO.StringWriter())); } --- 100,107 ---- public void IsType() { ! c = new IsTypeOf(typeof(TextReader)); ! Assert.IsTrue(!c.Eval(null)); ! Assert.IsTrue(c.Eval(new StringReader(""))); ! Assert.IsTrue(!c.Eval(new StringWriter())); } *************** *** 107,112 **** public void Not() { ! Assertion.Assert(new Not(new False()).Eval(null)); ! Assertion.Assert(!new Not(new True()).Eval(null)); } --- 109,114 ---- public void Not() { ! Assert.IsTrue(new Not(new False()).Eval(null)); ! Assert.IsTrue(!new Not(new True()).Eval(null)); } *************** *** 114,121 **** public void And() { ! Assertion.Assert( new And(new True() , new True() ).Eval(null)); ! Assertion.Assert(!new And(new True() , new False()).Eval(null)); ! Assertion.Assert(!new And(new False(), new True() ).Eval(null)); ! Assertion.Assert(!new And(new False(), new False()).Eval(null)); } --- 116,123 ---- public void And() { ! Assert.IsTrue( new And(new True() , new True() ).Eval(null)); ! Assert.IsTrue(!new And(new True() , new False()).Eval(null)); ! Assert.IsTrue(!new And(new False(), new True() ).Eval(null)); ! Assert.IsTrue(!new And(new False(), new False()).Eval(null)); } *************** *** 123,130 **** public void Or() { ! Assertion.Assert( new Or(new True() , new True() ).Eval(null)); ! Assertion.Assert( new Or(new True() , new False()).Eval(null)); ! Assertion.Assert( new Or(new False(), new True() ).Eval(null)); ! Assertion.Assert(!new Or(new False(), new False()).Eval(null)); } --- 125,132 ---- public void Or() { ! Assert.IsTrue( new Or(new True() , new True() ).Eval(null)); ! Assert.IsTrue( new Or(new True() , new False()).Eval(null)); ! Assert.IsTrue( new Or(new False(), new True() ).Eval(null)); ! Assert.IsTrue(!new Or(new False(), new False()).Eval(null)); } *************** *** 133,149 **** { c = new IsIn(2, 3, 5); ! Assertion.Assert(!c.Eval(1)); ! Assertion.Assert(c.Eval(2)); ! Assertion.Assert(c.Eval(3)); ! Assertion.Assert(!c.Eval(4)); ! Assertion.Assert(c.Eval(5)); ! Assertion.Assert(!c.Eval(6)); ! Assertion.Assert(!c.Eval(null)); int[] array = {1, 2}; c = new IsIn(array); ! Assertion.Assert(c.Eval(1)); ! Assertion.Assert(c.Eval(2)); ! Assertion.Assert(!c.Eval(3)); } --- 135,151 ---- { c = new IsIn(2, 3, 5); ! Assert.IsTrue(!c.Eval(1)); ! Assert.IsTrue(c.Eval(2)); ! Assert.IsTrue(c.Eval(3)); ! Assert.IsTrue(!c.Eval(4)); ! Assert.IsTrue(c.Eval(5)); ! Assert.IsTrue(!c.Eval(6)); ! Assert.IsTrue(!c.Eval(null)); int[] array = {1, 2}; c = new IsIn(array); ! Assert.IsTrue(c.Eval(1)); ! Assert.IsTrue(c.Eval(2)); ! Assert.IsTrue(!c.Eval(3)); } *************** *** 152,164 **** { c = new NotIn(1, 2); ! Assertion.Assert(!c.Eval(1)); ! Assertion.Assert(!c.Eval(2)); ! Assertion.Assert(c.Eval(3)); int[] array = {1, 2}; c = new NotIn(array); ! Assertion.Assert(!c.Eval(1)); ! Assertion.Assert(!c.Eval(2)); ! Assertion.Assert(c.Eval(3)); } --- 154,166 ---- { c = new NotIn(1, 2); ! Assert.IsTrue(!c.Eval(1)); ! Assert.IsTrue(!c.Eval(2)); ! Assert.IsTrue(c.Eval(3)); int[] array = {1, 2}; c = new NotIn(array); ! Assert.IsTrue(!c.Eval(1)); ! Assert.IsTrue(!c.Eval(2)); ! Assert.IsTrue(c.Eval(3)); } *************** *** 167,174 **** { c = new IsEqualIgnoreCase("heLLo"); ! Assertion.Assert(c.Eval("HELLO")); ! Assertion.Assert(c.Eval("hello")); ! Assertion.Assert(c.Eval("HelLo")); ! Assertion.Assert(!c.Eval("abcde")); } --- 169,176 ---- { c = new IsEqualIgnoreCase("heLLo"); ! Assert.IsTrue(c.Eval("HELLO")); ! Assert.IsTrue(c.Eval("hello")); ! Assert.IsTrue(c.Eval("HelLo")); ! Assert.IsTrue(!c.Eval("abcde")); } *************** *** 176,182 **** public void StripSpace() { ! Assertion.AssertEquals("Hello World", IsEqualIgnoreWhiteSpace.StripSpace("Hello\n \n World")); ! Assertion.AssertEquals("Hello World", IsEqualIgnoreWhiteSpace.StripSpace(" Hello World ")); ! Assertion.AssertEquals("", IsEqualIgnoreWhiteSpace.StripSpace(" ")); } --- 178,184 ---- public void StripSpace() { ! Assert.AreEqual("Hello World", IsEqualIgnoreWhiteSpace.StripSpace("Hello\n \n World")); ! Assert.AreEqual("Hello World", IsEqualIgnoreWhiteSpace.StripSpace(" Hello World ")); ! Assert.AreEqual("", IsEqualIgnoreWhiteSpace.StripSpace(" ")); } *************** *** 185,192 **** { c = new IsEqualIgnoreWhiteSpace("Hello World how\n are we?"); ! Assertion.Assert(c.Eval("Hello World how are we?")); ! Assertion.Assert(c.Eval(" Hello World how are \n\n\twe?")); ! Assertion.Assert(!c.Eval("HelloWorld how are we?")); ! Assertion.Assert(!c.Eval("Hello World how are we")); } --- 187,194 ---- { c = new IsEqualIgnoreWhiteSpace("Hello World how\n are we?"); ! Assert.IsTrue(c.Eval("Hello World how are we?")); ! Assert.IsTrue(c.Eval(" Hello World how are \n\n\twe?")); ! Assert.IsTrue(!c.Eval("HelloWorld how are we?")); ! Assert.IsTrue(!c.Eval("Hello World how are we")); } *************** *** 195,220 **** { c = new IsMatch(new Regex(@"^th[aeiou]\w* .*$")); ! Assertion.Assert(c.Eval("the world")); ! Assertion.Assert(!c.Eval("theworld")); ! Assertion.Assert(!c.Eval("ThE world")); ! Assertion.Assert(!c.Eval(" the world")); ! Assertion.Assert(c.Eval("thats nice")); ! Assertion.Assert(!c.Eval(new object())); ! Assertion.Assert(!c.Eval(null)); c = new IsMatch(@"^th[aeiou]\w* .*$"); ! Assertion.Assert(c.Eval("the world")); ! Assertion.Assert(!c.Eval("theworld")); ! Assertion.Assert(!c.Eval("ThE world")); c = new IsMatch(@"^th[aeiou]\w* .*$", false); ! Assertion.Assert(c.Eval("the world")); ! Assertion.Assert(!c.Eval("theworld")); ! Assertion.Assert(!c.Eval("ThE world")); c = new IsMatch(@"^th[aeiou]\w* .*$", true); ! Assertion.Assert(c.Eval("the world")); ! Assertion.Assert(!c.Eval("theworld")); ! Assertion.Assert(c.Eval("ThE world")); } --- 197,222 ---- { c = new IsMatch(new Regex(@"^th[aeiou]\w* .*$")); ! Assert.IsTrue(c.Eval("the world")); ! Assert.IsTrue(!c.Eval("theworld")); ! Assert.IsTrue(!c.Eval("ThE world")); ! Assert.IsTrue(!c.Eval(" the world")); ! Assert.IsTrue(c.Eval("thats nice")); ! Assert.IsTrue(!c.Eval(new object())); ! Assert.IsTrue(!c.Eval(null)); c = new IsMatch(@"^th[aeiou]\w* .*$"); ! Assert.IsTrue(c.Eval("the world")); ! Assert.IsTrue(!c.Eval("theworld")); ! Assert.IsTrue(!c.Eval("ThE world")); c = new IsMatch(@"^th[aeiou]\w* .*$", false); ! Assert.IsTrue(c.Eval("the world")); ! Assert.IsTrue(!c.Eval("theworld")); ! Assert.IsTrue(!c.Eval("ThE world")); c = new IsMatch(@"^th[aeiou]\w* .*$", true); ! Assert.IsTrue(c.Eval("the world")); ! Assert.IsTrue(!c.Eval("theworld")); ! Assert.IsTrue(c.Eval("ThE world")); } *************** *** 225,247 **** c = new IsCloseTo(1.0, 0.5); ! Assertion.Assert(c.Eval(1.0)); ! Assertion.Assert(c.Eval(0.5)); ! Assertion.Assert(c.Eval(1.5)); ! Assertion.Assert(c.Eval(1)); ! Assertion.Assert(c.Eval(0.5f)); ! Assertion.Assert(c.Eval(new decimal(1.5))); ! Assertion.Assert(!c.Eval(0.49)); ! Assertion.Assert(!c.Eval(1.51)); ! Assertion.Assert(!c.Eval(-1.0)); ! Assertion.Assert(c.Eval("1.2")); ! Assertion.Assert(!c.Eval("0.2")); ! Assertion.Assert(!c.Eval("hello")); ! Assertion.Assert(!c.Eval(null)); ! Assertion.Assert(!c.Eval(0)); ! Assertion.Assert(!c.Eval(0.0)); } --- 227,249 ---- c = new IsCloseTo(1.0, 0.5); ! Assert.IsTrue(c.Eval(1.0)); ! Assert.IsTrue(c.Eval(0.5)); ! Assert.IsTrue(c.Eval(1.5)); ! Assert.IsTrue(c.Eval(1)); ! Assert.IsTrue(c.Eval(0.5f)); ! Assert.IsTrue(c.Eval(new decimal(1.5))); ! Assert.IsTrue(!c.Eval(0.49)); ! Assert.IsTrue(!c.Eval(1.51)); ! Assert.IsTrue(!c.Eval(-1.0)); ! Assert.IsTrue(c.Eval("1.2")); ! Assert.IsTrue(!c.Eval("0.2")); ! Assert.IsTrue(!c.Eval("hello")); ! Assert.IsTrue(!c.Eval(null)); ! Assert.IsTrue(!c.Eval(0)); ! Assert.IsTrue(!c.Eval(0.0)); } *************** *** 253,264 **** // test property equals a value ! Assertion.Assert(new PropertyIs("MyProp", "hello").Eval(t)); ! Assertion.Assert(!new PropertyIs("MyProp", "bye").Eval(t)); // test property using another constraint ! Assertion.Assert(new PropertyIs("MyProp", new IsMatch("ell")).Eval(t)); ! Assertion.Assert(!new PropertyIs("MyProp", new IsMatch("sfsl")).Eval(t)); ! Assertion.AssertEquals( "Property MyProp: <x>", new PropertyIs("MyProp", new IsEqual("x")).Message); --- 255,266 ---- // test property equals a value ! Assert.IsTrue(new PropertyIs("MyProp", "hello").Eval(t)); ! Assert.IsTrue(!new PropertyIs("MyProp", "bye").Eval(t)); // test property using another constraint ! Assert.IsTrue(new PropertyIs("MyProp", new IsMatch("ell")).Eval(t)); ! Assert.IsTrue(!new PropertyIs("MyProp", new IsMatch("sfsl")).Eval(t)); ! Assert.AreEqual( "Property MyProp: <x>", new PropertyIs("MyProp", new IsEqual("x")).Message); *************** *** 268,272 **** public void PropertyIsWithNullValue() { ! Assertion.Assert(!new PropertyIs("Blah", new IsAnything()).Eval(null)); } --- 270,274 ---- public void PropertyIsWithNullValue() { ! Assert.IsTrue(!new PropertyIs("Blah", new IsAnything()).Eval(null)); } *************** *** 276,281 **** ThingWithProps t = new ThingWithProps(); ! Assertion.Assert(new PropertyIs("MyProp.Length", 5).Eval(t)); ! Assertion.Assert(!new PropertyIs("MyProp.Length", 9).Eval(t)); } --- 278,283 ---- ThingWithProps t = new ThingWithProps(); ! Assert.IsTrue(new PropertyIs("MyProp.Length", 5).Eval(t)); ! Assert.IsTrue(!new PropertyIs("MyProp.Length", 9).Eval(t)); } *************** *** 293,301 **** { CollectingConstraint c = new CollectingConstraint(); ! Assertion.Assert(c.Eval("test")); ! Assertion.AssertEquals("test", c.Parameter); ! Assertion.Assert("eval should always be true", c.Eval(null)); ! Assertion.AssertNull(c.Parameter); } --- 295,303 ---- { CollectingConstraint c = new CollectingConstraint(); ! Assert.IsTrue(c.Eval("test")); ! Assert.AreEqual("test", c.Parameter); ! Assert.IsTrue(c.Eval(null), "eval should always be true"); ! Assert.IsNull(c.Parameter); } *************** *** 306,313 **** c = new Constraint(new Constraint.Method(myEval)); myFlag = false; ! Assertion.Assert(c.Eval(null)); ! Assertion.Assert(!c.Eval(null)); ! Assertion.Assert(c.Eval(null)); ! Assertion.Assert(!c.Eval(null)); } --- 308,315 ---- c = new Constraint(new Constraint.Method(myEval)); myFlag = false; ! Assert.IsTrue(c.Eval(null)); ! Assert.IsTrue(!c.Eval(null)); ! Assert.IsTrue(c.Eval(null)); ! Assert.IsTrue(!c.Eval(null)); } *************** *** 315,334 **** public void Messages() { ! Assertion.AssertEquals("null", new IsNull().Message); ! Assertion.AssertEquals("", new IsAnything().Message); ! Assertion.AssertEquals("IN <hi>, <1>, <bye>", new IsIn("hi", 1, "bye").Message); ! Assertion.AssertEquals("<hi>", new IsEqual("hi").Message); ! Assertion.AssertEquals("typeof <System.String>", new IsTypeOf(typeof(System.String)).Message); ! Assertion.AssertEquals("NOT DUMMY", new Not(new Dummy()).Message); ! Assertion.AssertEquals("DUMMY AND DUMMY", new And(new Dummy(), new Dummy()).Message); ! Assertion.AssertEquals("DUMMY OR DUMMY", new Or(new Dummy(), new Dummy()).Message); ! Assertion.AssertEquals("NOT null", new NotNull().Message); ! Assertion.AssertEquals("NOT <hi>", new NotEqual("hi").Message); ! Assertion.AssertEquals("NOT IN <hi>, <1>, <bye>", new NotIn("hi", 1, "bye").Message); ! Assertion.AssertEquals("<hi>", new IsEqualIgnoreCase("hi").Message); ! Assertion.AssertEquals("<hi>", new IsEqualIgnoreWhiteSpace("hi").Message); ! Assertion.AssertEquals("<hi>", new IsMatch("hi").Message); ! Assertion.AssertEquals("<7>", new IsCloseTo(7.0, 1.1).Message); ! Assertion.AssertEquals("Custom Constraint", new Constraint(new Constraint.Method(myEval)).Message); } private bool myFlag; --- 317,336 ---- public void Messages() { ! Assert.AreEqual("null", new IsNull().Message); ! Assert.AreEqual("", new IsAnything().Message); ! Assert.AreEqual("IN <hi>, <1>, <bye>", new IsIn("hi", 1, "bye").Message); ! Assert.AreEqual("<hi>", new IsEqual("hi").Message); ! Assert.AreEqual("typeof <System.String>", new IsTypeOf(typeof(String)).Message); ! Assert.AreEqual("NOT DUMMY", new Not(new Dummy()).Message); ! Assert.AreEqual("DUMMY AND DUMMY", new And(new Dummy(), new Dummy()).Message); ! Assert.AreEqual("DUMMY OR DUMMY", new Or(new Dummy(), new Dummy()).Message); ! Assert.AreEqual("NOT null", new NotNull().Message); ! Assert.AreEqual("NOT <hi>", new NotEqual("hi").Message); ! Assert.AreEqual("NOT IN <hi>, <1>, <bye>", new NotIn("hi", 1, "bye").Message); ! Assert.AreEqual("<hi>", new IsEqualIgnoreCase("hi").Message); ! Assert.AreEqual("<hi>", new IsEqualIgnoreWhiteSpace("hi").Message); ! Assert.AreEqual("<hi>", new IsMatch("hi").Message); ! Assert.AreEqual("<7>", new IsCloseTo(7.0, 1.1).Message); ! Assert.AreEqual("Custom Constraint", new Constraint(new Constraint.Method(myEval)).Message); } private bool myFlag; *************** *** 411,417 **** ExtractingConstraint constraint = new ExtractingConstraint("E"); ! Assertion.AssertEquals("Should be modified value", "A", constraint.ExtractActualValue("ACTUAL")); ! Assertion.Assert("Should match", constraint.Eval("EQUALS FIRST CHAR")); ! Assertion.Assert("Should be different", new Not(constraint).Eval("NOT EQUAL")); } #endregion --- 413,419 ---- ExtractingConstraint constraint = new ExtractingConstraint("E"); ! Assert.AreEqual("A", constraint.ExtractActualValue("ACTUAL"), "Should be modified value"); ! Assert.IsTrue(constraint.Eval("EQUALS FIRST CHAR"), "Should match"); ! Assert.IsTrue(new Not(constraint).Eval("NOT EQUAL"), "Should be different"); } #endregion Index: IsArrayEqualTest.cs =================================================================== RCS file: /cvsroot/nmock/nmock/test/NMock/Constraints/IsArrayEqualTest.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IsArrayEqualTest.cs 11 Jul 2003 08:32:38 -0000 1.1 --- IsArrayEqualTest.cs 22 Oct 2004 11:46:27 -0000 1.2 *************** *** 1,5 **** // Contributed by Luke Maxon <lt...@th...> - using System; using System.Collections; using NUnit.Framework; --- 1,4 ---- *************** *** 18,24 **** IsListEqual c = new IsListEqual(o1); ! Assertion.Assert(!c.Eval(o2)); ! Assertion.Assert(!c.Eval(o1)); ! Assertion.Assert(!c.Eval(null)); } --- 17,23 ---- IsListEqual c = new IsListEqual(o1); ! Assert.IsTrue(!c.Eval(o2)); ! Assert.IsTrue(!c.Eval(o1)); ! Assert.IsTrue(!c.Eval(null)); } *************** *** 30,36 **** IsListEqual c = new IsListEqual(o1); ! Assertion.Assert(c.Eval(o2)); ! Assertion.Assert(c.Eval(o1)); ! Assertion.Assert(!c.Eval(null)); } --- 29,35 ---- IsListEqual c = new IsListEqual(o1); ! Assert.IsTrue(c.Eval(o2)); ! Assert.IsTrue(c.Eval(o1)); ! Assert.IsTrue(!c.Eval(null)); } *************** *** 42,46 **** IsListEqual c = new IsListEqual(o1); ! Assertion.Assert(!c.Eval(o2)); } --- 41,45 ---- IsListEqual c = new IsListEqual(o1); ! Assert.IsTrue(!c.Eval(o2)); } *************** *** 52,56 **** IsListEqual c = new IsListEqual(o1); ! Assertion.Assert(c.Eval(o2)); } --- 51,55 ---- IsListEqual c = new IsListEqual(o1); ! Assert.IsTrue(c.Eval(o2)); } *************** *** 62,66 **** IsListEqual c = new IsListEqual(o1); ! Assertion.Assert(!c.Eval(o2)); } --- 61,65 ---- IsListEqual c = new IsListEqual(o1); ! Assert.IsTrue(!c.Eval(o2)); } *************** *** 72,76 **** IsListEqual c = new IsListEqual(o1); ! Assertion.Assert(c.Eval(o2)); } --- 71,75 ---- IsListEqual c = new IsListEqual(o1); ! Assert.IsTrue(c.Eval(o2)); } *************** *** 82,86 **** IsListEqual c = new IsListEqual(o1); ! Assertion.Assert(!c.Eval(o2)); } } --- 81,85 ---- IsListEqual c = new IsListEqual(o1); ! Assert.IsTrue(!c.Eval(o2)); } } *************** *** 96,102 **** IsListEqual c = new IsListEqual(o1); ! Assertion.Assert(!c.Eval(o2)); ! Assertion.Assert(!c.Eval(o1)); ! Assertion.Assert(!c.Eval(null)); } --- 95,101 ---- IsListEqual c = new IsListEqual(o1); ! Assert.IsTrue(!c.Eval(o2)); ! Assert.IsTrue(!c.Eval(o1)); ! Assert.IsTrue(!c.Eval(null)); } *************** *** 108,114 **** IsListEqual c = new IsListEqual(o1); ! Assertion.Assert(c.Eval(o2)); ! Assertion.Assert(c.Eval(o1)); ! Assertion.Assert(!c.Eval(null)); } --- 107,113 ---- IsListEqual c = new IsListEqual(o1); ! Assert.IsTrue(c.Eval(o2)); ! Assert.IsTrue(c.Eval(o1)); ! Assert.IsTrue(!c.Eval(null)); } *************** *** 120,124 **** IsListEqual c = new IsListEqual(o1); ! Assertion.Assert(!c.Eval(o2)); } --- 119,123 ---- IsListEqual c = new IsListEqual(o1); ! Assert.IsTrue(!c.Eval(o2)); } *************** *** 130,134 **** IsListEqual c = new IsListEqual(o1); ! Assertion.Assert(c.Eval(o2)); } --- 129,133 ---- IsListEqual c = new IsListEqual(o1); ! Assert.IsTrue(c.Eval(o2)); } *************** *** 140,144 **** IsListEqual c = new IsListEqual(o1); ! Assertion.Assert(!c.Eval(o2)); } --- 139,143 ---- IsListEqual c = new IsListEqual(o1); ! Assert.IsTrue(!c.Eval(o2)); } *************** *** 150,154 **** IsListEqual c = new IsListEqual(o1); ! Assertion.Assert(c.Eval(o2)); } --- 149,153 ---- IsListEqual c = new IsListEqual(o1); ! Assert.IsTrue(c.Eval(o2)); } *************** *** 160,166 **** IsListEqual c = new IsListEqual(o1); ! Assertion.Assert(!c.Eval(o2)); } ! } ! } \ No newline at end of file --- 159,164 ---- IsListEqual c = new IsListEqual(o1); ! Assert.IsTrue(!c.Eval(o2)); } ! } } \ No newline at end of file |
|
From: Owen R. <exo...@us...> - 2004-10-22 11:47:07
|
Update of /cvsroot/nmock/nmock In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19470 Modified Files: nmock.build Log Message: upgraded to nunit 2.2 upgraded to new version of NAnt Index: nmock.build =================================================================== RCS file: /cvsroot/nmock/nmock/nmock.build,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** nmock.build 14 Jun 2004 17:54:45 -0000 1.9 --- nmock.build 22 Oct 2004 11:46:26 -0000 1.10 *************** *** 16,20 **** <csc target="library" output="build/nmock.dll" debug="true"> <sources> ! <includes name="src/**.cs"/> </sources> </csc> --- 16,20 ---- <csc target="library" output="build/nmock.dll" debug="true"> <sources> ! <include name="src/**.cs"/> </sources> </csc> *************** *** 24,33 **** <csc target="library" output="build/nmock.test.dll" debug="true"> <sources> ! <includes name="test/**.cs"/> ! <includes name="sample/**.cs"/> </sources> <references> ! <includes name="build/nmock.dll"/> ! <includes name="lib/*.dll"/> </references> <arg value="/nowarn:0679,1591"/> --- 24,33 ---- <csc target="library" output="build/nmock.test.dll" debug="true"> <sources> ! <include name="test/**.cs"/> ! <include name="sample/**.cs"/> </sources> <references> ! <include name="build/nmock.dll"/> ! <include name="lib/*.dll"/> </references> <arg value="/nowarn:0679,1591"/> *************** *** 56,60 **** <csc target="library" output="dist/nmock.dll" debug="false"> <sources> ! <includes name="src/**.cs"/> </sources> </csc> --- 56,60 ---- <csc target="library" output="dist/nmock.dll" debug="false"> <sources> ! <include name="src/**.cs"/> </sources> </csc> |