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
(24) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Vaughn, C. <Va...@va...> - 2003-08-01 15:29:18
|
Hello,
I have a test fixture that's causing me trouble. Can someone look at it and
provide some comments. In general, I have problems returning value types
and calling SetupResult() in various cases.
using System;
using NUnit.Framework;
using NMock;
using NMock.Dynamic;
using NMock.Constraints;
//using Explorer.Gui;
//using System.Windows.Forms;
namespace Explorer.Tests
{
/// <summary>
/// Summary description for NMockTest.
/// </summary>
[TestFixture]
public class NMockTest
{
public NMockTest()
{
}
bool m_test = false;
private void eTester( object sender, EventArgs e )
{
m_test = true;
}
public interface IBar
{
string Age { get; }
string BaseCall();
}
public interface IFoo : IBar
{
string Name { get; set; }
event EventHandler Test;
void Bar();
void Bar( string text );
}
public void TestSetupResultAndExpect()
{
DynamicMock foo = new DynamicMock( typeof( IFoo ) );
IFoo ifoo = ((IFoo)foo.MockInstance);
foo.SetupResult( "Name", "bob" );
foo.Expect( "Name", "bill" );
System.Diagnostics.Debug.Write( ifoo.Name );
ifoo.Name = "bill";
foo.Verify();
}
public void TestExpectAndReturnAndExpect()
{
DynamicMock foo = new DynamicMock( typeof( IFoo ) );
IFoo ifoo = ((IFoo)foo.MockInstance);
foo.ExpectAndReturn( "Name", "bob" );
foo.Expect( "Name", "bill" );
System.Diagnostics.Debug.Write( ifoo.Name );
ifoo.Name = "bill";
foo.Verify();
}
public void TestBasePropertySetupResult()
{
IMock foo = new DynamicMock( typeof( IFoo ) );
IFoo ifoo = ((IFoo)foo.MockInstance);
foo.SetupResult( "Age", "bob" );
System.Diagnostics.Debug.Write( ifoo.Age);
foo.Verify();
}
public void TestBasePropertyExpectAndReturn()
{
IMock foo = new DynamicMock( typeof( IFoo ) );
IFoo ifoo = ((IFoo)foo.MockInstance);
foo.ExpectAndReturn( "Age", "bob" );
System.Diagnostics.Debug.Write( ifoo.Age );
foo.Verify();
}
[ExpectedException(typeof(VerifyException))]
public void TestPropertyRetTypeFailExpected()
{
DynamicMock foo = new DynamicMock( typeof( IFoo ) );
IFoo ifoo = ((IFoo)foo.MockInstance);
foo.SetupResult( "Age", 1 );
System.Diagnostics.Debug.Write( ifoo.Age);
foo.Verify();
}
public void TestBaseMethodSetupResult()
{
DynamicMock foo = new DynamicMock( typeof( IFoo ) );
IFoo ifoo = ((IFoo)foo.MockInstance);
foo.SetupResult( "BaseCall", "bob" );
System.Diagnostics.Debug.Write( ifoo.BaseCall() );
foo.Verify();
}
[ExpectedException(typeof(VerifyException))]
public void TestMethodRetTypeFailExpected()
{
DynamicMock foo = new DynamicMock( typeof( IFoo ) );
IFoo ifoo = ((IFoo)foo.MockInstance);
foo.SetupResult( "BaseCall", 1 );
System.Diagnostics.Debug.Write( ifoo.BaseCall() );
foo.Verify();
}
public void TestEvent()
{
IMock foo = new DynamicMock( typeof( IFoo ) );
IFoo ifoo = ((IFoo)foo.MockInstance);
CollectingConstraint h = new CollectingConstraint();
foo.Expect( "add_Test", h );
ifoo.Test += new EventHandler( eTester );
((EventHandler)h.Parameter)( null, null );
Assertion.AssertEquals( "Event", true, m_test );
foo.Verify();
}
// this test should fail
[ExpectedException(typeof(VerifyException))]
public void TestBarFailExpected()
{
DynamicMock foo = new DynamicMock( typeof( IFoo ) );
IFoo ifoo = ((IFoo)foo.MockInstance);
foo.Expect( "Bar" );
ifoo.Bar( "test" );
foo.Verify();
}
public interface IFoo2
{
System.Drawing.Color color { get; }
DateTime date { get; }
}
public void TestColor()
{
IMock foo = new DynamicMock( typeof( IFoo2 ), "bob"
);
foo.ExpectAndReturn( "color",
System.Drawing.Color.Black );
foo.ExpectAndReturn( "date", DateTime.Now.Date );
System.Drawing.Color c =
((IFoo2)foo.MockInstance).color;
DateTime d = ((IFoo2)foo.MockInstance).date;
Assertion.AssertEquals( "color",
System.Drawing.Color.Black, c );
Assertion.AssertEquals( "date", DateTime.Now.Date, d
);
}
}
}
Also, one of the tests I submitted would pass if you change the
initialization of "ignore" from one of the constructors and just do it at
declaration time like so:
public class DynamicMock : Mock
{
private object obj;
private Type type;
private IList ignore= new ArrayList();
...
}
And finally, I think if you should provide an "Expect..." function that will
ignore parameters, versus having Expect() ignore and check. the combined
nature of the current Expect() confuses my "TestBarFailExpected"
thanx
cliff
This message may have included proprietary or protected information. This
message and the information contained herein are not to be further
communicated without my express written consent.
|
|
From: Vaughn, C. <Va...@va...> - 2003-08-01 14:25:31
|
I think these two tests should behave the same. What do you guys think?
public interface IBar
{
string Age { get; }
string BaseCall();
}
public interface IFoo : IBar
{
string Name { get; set; }
event EventHandler Test;
void Bar();
void Bar( string text );
}
public void TestSetupResult()
{
DynamicMock foo = new DynamicMock( typeof( IFoo ) );
IFoo ifoo = ((IFoo)foo.MockInstance);
foo.SetupResult( "Name", "bob" );
foo.Expect( "Name", "bill" );
System.Diagnostics.Debug.Write( ifoo.Name );
ifoo.Name = "bill";
foo.Verify();
}
public void TestExpectAndReturn()
{
DynamicMock foo = new DynamicMock( typeof( IFoo ) );
IFoo ifoo = ((IFoo)foo.MockInstance);
foo.ExpectAndReturn( "Name", "bob" );
foo.Expect( "Name", "bill" );
System.Diagnostics.Debug.Write( ifoo.Name );
ifoo.Name = "bill";
foo.Verify();
}
cliff
This message may have included proprietary or protected information. This
message and the information contained herein are not to be further
communicated without my express written consent.
|
|
From: Vaughn, C. <Va...@va...> - 2003-08-01 14:22:31
|
Hello all,
Here's a test that fails for named dynamic mocks.
[Test]
public void NamedDynamicMockMethodCall()
{
IMock mock = new DynamicMock(typeof(IBlah),
"XBlah");
Assertion.AssertEquals("XBlah", mock.Name);
mock.ExpectAndReturn("DoStuff", "world", "hello");
IBlah blah = (IBlah)mock.MockInstance;
Assertion.AssertEquals("world",
blah.DoStuff("hello"));
mock.Verify();
}
Clifton F. Vaughn
This message may have included proprietary or protected information. This
message and the information contained herein are not to be further
communicated without my express written consent.
|
|
From: Vaughn, C. <Va...@va...> - 2003-07-31 12:36:56
|
Is the patch already supposed to be in CVS. I'm using the latest
ClassGenerator.cs, but I still have a problem with System.Drawing.Color.
Should I grab other files? I'm not using all of them because of the change
to SetupResult() that now takes Type[] instead of object[].
cliff
-----Original Message-----
From: Joe Walnes [mailto:jo...@tr...]
Sent: Friday, July 25, 2003 1:00 PM
To: Vaughn, Clifton
Cc: 'Nmo...@li...'; TMa...@th...
Subject: Re: [Nmock-general] a funny thing with structs
It's funny you should say this. Tim Mackinnon came across the problem
with structs today - and he's fixed it.
Tim, where's our patch? ;)
-joe
Vaughn, Clifton wrote:
>I tried the following test case and i get a wierd error:
>
> public interface ITestStruct
> {
> System.Drawing.Point getPoint();
> void setPoint( System.Drawing.Point pt );
> }
> public void TestStruct()
> {
> DynamicMock foo = new DynamicMock( typeof(
>ITestStruct ));
> ITestStruct ifoo = (ITestStruct)foo.MockInstance;
> System.Drawing.Point p1 = new
>System.Drawing.Point(1,2);
> foo.ExpectAndReturn( "getPoint", p1 );
> foo.Expect( "setPoint", p1 );
>
> ifoo.setPoint( ifoo.getPoint() );
> foo.Verify();
> }
>
>c:\documents and settings\vaughnc.vci\my
>documents\dev\media\tests\tnfwmarketscontroller.cs(52):
>TargetNavigator.Tests.TNfwMarketsController.TestStruct: setPoint() called
>with incorrect parameter (1)
>expected:<{X=1,Y=2}>
> but was:<{X=322283128,Y=0}>
>
>This also happens with DateTime. Any ideas?
>
>cliff
>
>
>-------------------------------------------------------
>This SF.Net email sponsored by: Free pre-built ASP.NET sites including
>Data Reports, E-commerce, Portals, and Forums are available now.
>Download today and enter to win an XBOX or Visual Studio .NET.
>http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
>_______________________________________________
>Nmock-general mailing list
>Nmo...@li...
>https://lists.sourceforge.net/lists/listinfo/nmock-general
>
>
|
|
From: Mike R. <mi...@th...> - 2003-07-30 19:39:22
|
Joe Walnes wrote: > Awesome, Mike. Thanks! > > Could you do one last thing and hyperlink the files in the > 'modifications since last build' to viewcvs at: > http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/nmock/nmock/ Urrk - I'm a tad busy at the mo, but if you grab the source (there's a zip file of latest (as of now) good at http://ccnetlive.thoughtworks.com/CCNet-builds/4/CruiseControl.NET.source.zip) and make a change to the XSL let me know. > BTW, how can I make modifications to the cc instance (i.e. skin)? You can't make changes yourself since I'm not sure I can give out user details to the server that its running on. However, its just running the vanilla skin from the source above so if you want to change it email me the updates. Mike |
|
From: Joe W. <jo...@tr...> - 2003-07-30 18:18:38
|
Awesome, Mike. Thanks! Could you do one last thing and hyperlink the files in the 'modifications since last build' to viewcvs at: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/nmock/nmock/ BTW, how can I make modifications to the cc instance (i.e. skin)? Owen, could you look at the remoting problem. cheers -joe Mike Roberts wrote: > Hi guys, > > I've setup a publically-viewable instance of CruiseControl.NET - the > website is at http://ccnetlive.thoughtworks.com/nmock/. At the moment > its not labelling or publishing binaries to a known location but I'll > set that up soon and reply just to the mailing list. > > At the moment the build is failing one test - after a bit of > experimenting it seems that test fails if there is something running > with remoting on the same machine (CruiseControl.NET uses remoting), > so you might want to fix it or ignore for now. > > Cheers, > > Mike > > > > > |
|
From: Mike R. <mi...@th...> - 2003-07-30 17:44:51
|
Hi guys, I've setup a publically-viewable instance of CruiseControl.NET - the website is at http://ccnetlive.thoughtworks.com/nmock/. At the moment its not labelling or publishing binaries to a known location but I'll set that up soon and reply just to the mailing list. At the moment the build is failing one test - after a bit of experimenting it seems that test fails if there is something running with remoting on the same machine (CruiseControl.NET uses remoting), so you might want to fix it or ignore for now. Cheers, Mike |
|
From: <sm...@us...> - 2003-07-30 17:28:45
|
Update of /cvsroot/nmock/nmock/test/NMock
In directory sc8-pr-cvs1:/tmp/cvs-serv21950/test/NMock
Modified Files:
DynamicMockTest.cs
Log Message:
Added CannotCreateMockInstanceWithNonEmptyConstructor
Index: DynamicMockTest.cs
===================================================================
RCS file: /cvsroot/nmock/nmock/test/NMock/DynamicMockTest.cs,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** DynamicMockTest.cs 30 Jul 2003 16:57:01 -0000 1.10
--- DynamicMockTest.cs 30 Jul 2003 17:28:42 -0000 1.11
***************
*** 60,63 ****
--- 60,69 ----
void WithoutLeadingParameter(params object[] args);
}
+ class WithNonEmptyConstructor
+ {
+ public WithNonEmptyConstructor(string unused)
+ {
+ }
+ }
#endregion
***************
*** 206,210 ****
mock.Verify();
}
!
}
}
--- 212,220 ----
mock.Verify();
}
! [Test] [ExpectedException(typeof(NotSupportedException))] public void CannotCreateMockInstanceWithNonEmptyConstructor()
! {
! IMock mock = new DynamicMock(typeof(WithNonEmptyConstructor));
! WithNonEmptyConstructor nonEmpty = (WithNonEmptyConstructor)mock.MockInstance;
! }
}
}
|
|
From: <sm...@us...> - 2003-07-30 17:28:08
|
Update of /cvsroot/nmock/nmock/test/NMock/Dynamic
In directory sc8-pr-cvs1:/tmp/cvs-serv21832/test/NMock/Dynamic
Modified Files:
ClassGeneratorTest.cs
Log Message:
Some layout
Added tests to show limitations, e.g. DoesNotOverrideToString()
Index: ClassGeneratorTest.cs
===================================================================
RCS file: /cvsroot/nmock/nmock/test/NMock/Dynamic/ClassGeneratorTest.cs,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** ClassGeneratorTest.cs 30 Jul 2003 15:01:28 -0000 1.10
--- ClassGeneratorTest.cs 30 Jul 2003 17:28:01 -0000 1.11
***************
*** 10,14 ****
namespace NMock.Dynamic
{
!
public interface IThingy
{
--- 10,14 ----
namespace NMock.Dynamic
{
! #region types
public interface IThingy
{
***************
*** 40,44 ****
}
! public abstract class SolidThingy : ISolidThingy
{
// internal and protected internal methods must be overridable!
--- 40,44 ----
}
! public abstract class AbstractThingy : ISolidThingy
{
// internal and protected internal methods must be overridable!
***************
*** 72,75 ****
--- 72,80 ----
A, B, C, D
}
+ public class ConcreteThing
+ {
+ public virtual void NoArgs() { Assertion.Fail("Should have been overriden"); }
+ }
+ #endregion
[TestFixture] public class ClassGeneratorTest
***************
*** 257,264 ****
}
! [Test] public void ExtendClass()
{
cg = new ClassGenerator();
! SolidThingy s = (SolidThingy)cg.Generate(typeof(SolidThingy), mock);
mock.ExpectAndReturn("VirtualMethod", "hello");
--- 262,269 ----
}
! [Test] public void CanExtendAbstractClass()
{
cg = new ClassGenerator();
! AbstractThingy s = (AbstractThingy)cg.Generate(typeof(AbstractThingy), mock);
mock.ExpectAndReturn("VirtualMethod", "hello");
***************
*** 272,289 ****
Assertion.AssertEquals("white", s.ProtectedInternalMethod());
- Assertion.AssertEquals("xx", s.NonVirtualMethod());
- Assertion.AssertEquals("xx", s.NonVirtualProperty);
- Assertion.AssertEquals("xx", s.ToString());
mock.Verify();
}
- [Test] [ExpectedException(typeof(TypeLoadException))] public void CannotMockClassWithInternalMethodBecauseOfAssemblyVisibility()
- {
- new ClassGenerator().Generate(typeof(ClassWithInternalMethod), mock);
- }
-
[Test] public void CheckBoxingOpCodes()
{
! BoxingOpCodes opCodes = new BoxingOpCodes();
Assertion.AssertEquals( OpCodes.Ldind_I1, opCodes[typeof(sbyte)] );
--- 277,286 ----
Assertion.AssertEquals("white", s.ProtectedInternalMethod());
mock.Verify();
}
[Test] public void CheckBoxingOpCodes()
{
! BoxingOpCodes opCodes = new BoxingOpCodes();
Assertion.AssertEquals( OpCodes.Ldind_I1, opCodes[typeof(sbyte)] );
***************
*** 300,303 ****
--- 297,339 ----
Assertion.AssertEquals( OpCodes.Ldind_I1, opCodes[typeof(bool)] );
}
+ [Test] public void CanExtendConcreteClass()
+ {
+ ConcreteThing concrete = (ConcreteThing)(new ClassGenerator()).Generate(typeof(ConcreteThing), mock);
+
+ mock.Expect("NoArgs");
+ concrete.NoArgs();
+ mock.Verify();
+ }
+
+ // Limitations
+ [Test] public void CannotOverrideNonVirtualFeatures()
+ {
+ cg = new ClassGenerator();
+ AbstractThingy s = (AbstractThingy)cg.Generate(typeof(AbstractThingy), mock);
+
+ 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();
+ AbstractThingy s = (AbstractThingy)cg.Generate(typeof(AbstractThingy), mock);
+
+ mock.SetupResult("ToString", "to string");
+
+ Assertion.AssertEquals("xx", s.ToString());
+ mock.Verify();
+ }
+
+ [Test] [ExpectedException(typeof(TypeLoadException))] public void CannotMockClassWithInternalMethodBecauseOfAssemblyVisibility()
+ {
+ new ClassGenerator().Generate(typeof(ClassWithInternalMethod), mock);
+ }
+
}
|
|
From: <mik...@us...> - 2003-07-30 17:17:07
|
Update of /cvsroot/nmock/nmock/test In directory sc8-pr-cvs1:/tmp/cvs-serv20058/test Modified Files: AssemblyInfo.cs Log Message: Test Change for CruiseControl.NET Index: AssemblyInfo.cs =================================================================== RCS file: /cvsroot/nmock/nmock/test/AssemblyInfo.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AssemblyInfo.cs 16 Dec 2002 15:04:48 -0000 1.2 --- AssemblyInfo.cs 30 Jul 2003 17:17:04 -0000 1.3 *************** *** 56,58 **** // [assembly: AssemblyDelaySign(false)] // [assembly: AssemblyKeyFile("")] ! // [assembly: AssemblyKeyName("")] --- 56,58 ---- // [assembly: AssemblyDelaySign(false)] // [assembly: AssemblyKeyFile("")] ! // [assembly: AssemblyKeyName("")] \ No newline at end of file |
|
From: <mik...@us...> - 2003-07-30 17:10:36
|
Update of /cvsroot/nmock/nmock In directory sc8-pr-cvs1:/tmp/cvs-serv18381 Modified Files: nmock.build Log Message: Adding CruiseControl.NET bootstrap build file (removing bootstrap behaviour from main build file) Index: nmock.build =================================================================== RCS file: /cvsroot/nmock/nmock/nmock.build,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** nmock.build 31 Dec 2002 21:36:37 -0000 1.3 --- nmock.build 30 Jul 2003 17:10:33 -0000 1.4 *************** *** 64,68 **** <target name="cruise"> <property name="nunit.output" value="Xml"/> - <exec program="cvs.exe" commandline="-q update -P -d" /> <call target="release"/> </target> --- 64,67 ---- |
|
From: <sm...@us...> - 2003-07-30 16:57:06
|
Update of /cvsroot/nmock/nmock/test/NMock
In directory sc8-pr-cvs1:/tmp/cvs-serv15584/test/NMock
Modified Files:
DynamicMockTest.cs
Log Message:
Repaired borken DynamicMockTest. Still not sure what was wrong.
Index: DynamicMockTest.cs
===================================================================
RCS file: /cvsroot/nmock/nmock/test/NMock/DynamicMockTest.cs,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** DynamicMockTest.cs 30 Jul 2003 15:02:03 -0000 1.9
--- DynamicMockTest.cs 30 Jul 2003 16:57:01 -0000 1.10
***************
*** 6,9 ****
--- 6,10 ----
namespace NMock
{
+
[TestFixture] public class DynamicMockTest : Assertion
{
***************
*** 19,23 ****
}
! class CustomMock : DynamicMock
{
public CustomMock(Type t) : base(t) {}
--- 20,24 ----
}
! private class CustomMock : DynamicMock
{
public CustomMock(Type t) : base(t) {}
***************
*** 28,55 ****
}
}
!
! class SameClass
{
public virtual string A() { return c() ? b() : "Default"; }
! protected virtual string b() { throw new AssertionException("Should not have been called"); }
protected virtual bool c() { return true; }
}
! class SameClassCaller
{
! SameClass _sameClass;
! public SameClassCaller(SameClass sc) { _sameClass = sc; }
! public virtual string CallSameClass() { return _sameClass.A(); }
}
public class Thingy
{
public void X() {}
}
-
- interface IValueType
- {
- ArrayList Query(string symbol, DateTime arg2);
- }
-
interface IOverloadedMethods
{
--- 29,48 ----
}
}
! public class SameClass
{
public virtual string A() { return c() ? b() : "Default"; }
! protected virtual string b() { throw new Exception("Should not have called b()"); }
protected virtual bool c() { return true; }
}
! interface IValueType
{
! ArrayList Query(string symbol, DateTime arg2);
}
+
public class Thingy
{
public void X() {}
}
interface IOverloadedMethods
{
***************
*** 57,79 ****
void DoStuff(string one);
}
!
! interface SomeTestInterface
{
void Foo(String a);
int Bar(String a);
}
! #endregion
!
! [Test] public void DynamicallyImplementsAnInterface()
{
! IMock mock = new DynamicMock(typeof(IBlah));
! mock.ExpectAndReturn("DoStuff", "world", "hello");
!
! IBlah blah = (IBlah)mock.MockInstance;
! Assertion.AssertEquals("world", blah.DoStuff("hello"));
!
! mock.Verify();
}
! [Test] public void HasADefaultNameBasedOnMockedType()
{
IMock mock = new DynamicMock(typeof(IBlah));
--- 50,66 ----
void DoStuff(string one);
}
! interface TwoMethods
{
void Foo(String a);
int Bar(String a);
}
! interface IWithParams
{
! void WithLeadingParameter(int i, params object[] args);
! void WithoutLeadingParameter(params object[] args);
}
! #endregion
!
! [Test] public void HasADefaultNameBasedOnMockedType()
{
IMock mock = new DynamicMock(typeof(IBlah));
***************
*** 87,90 ****
--- 74,89 ----
}
+ [Test] public void DynamicallyImplementsAnInterface()
+ {
+ IMock mock = new DynamicMock(typeof(IBlah));
+
+ mock.ExpectAndReturn("DoStuff", "world", "hello");
+
+ IBlah blah = (IBlah)mock.MockInstance;
+ Assertion.AssertEquals("world", blah.DoStuff("hello"));
+
+ mock.Verify();
+ }
+
[Test] public void CanBeCustomisedByOverridingCallMethod()
{
***************
*** 95,120 ****
}
! [Test] public void CanStubMultipleCallsToSameObject()
{
DynamicMock mock = new DynamicMock(typeof(SameClass));
mock.Ignore("A");
mock.Ignore("c");
mock.SetupResult("b", "hello");
! Assertion.AssertEquals("hello", ((SameClass)mock.MockInstance).A());
}
! [Test] public void CanSetStubsAndExpectationsOnSameObject()
{
DynamicMock mock = new DynamicMock(typeof(SameClass));
- SameClass sc = (SameClass)mock.MockInstance;
- SameClassCaller caller = new SameClassCaller(sc);
-
mock.Ignore("A");
mock.ExpectAndReturn("c", true);
mock.SetupResult("b", "hello");
! Assertion.AssertEquals("hello", caller.CallSameClass());
mock.Verify();
--- 94,119 ----
}
! [Test] public void StubbedMethodsCanBeCalledByOtherMethodsWithinObject()
{
DynamicMock mock = new DynamicMock(typeof(SameClass));
mock.Ignore("A");
mock.Ignore("c");
+ SameClass sc = (SameClass)mock.MockInstance;
+
mock.SetupResult("b", "hello");
! Assertion.AssertEquals("hello", sc.A());
}
! [Test] public void CanSetStubsAndExpectationsOnMethodsInTheSameClass()
{
DynamicMock mock = new DynamicMock(typeof(SameClass));
mock.Ignore("A");
+ SameClass sc = (SameClass)mock.MockInstance;
mock.ExpectAndReturn("c", true);
mock.SetupResult("b", "hello");
! AssertEquals("Should have overriden B()", "hello", sc.A());
mock.Verify();
***************
*** 132,148 ****
}
! [Test] public void ExpectationWillFailIfValueDoesntMatchMockInstance()
{
! DynamicMock mockThingy = new DynamicMock(typeof(Thingy));
! Thingy thingy = (Thingy)mockThingy.MockInstance;
Mock m2 = new Mock("x");
m2.Expect("y", thingy);
! try
! {
! m2.Call("y", "something else");
! Fail("Should have thrown Verify Exception");
! }
! catch (VerifyException) {};
}
--- 131,142 ----
}
! [Test] [ExpectedException(typeof(VerifyException))] public void ExpectationWillFailIfValueDoesntMatchMockInstance()
{
! DynamicMock m1 = new DynamicMock(typeof(Thingy));
! Thingy thingy = (Thingy)m1.MockInstance;
Mock m2 = new Mock("x");
m2.Expect("y", thingy);
! m2.Call("y", "something else");
}
***************
*** 150,154 ****
{
IMock mock = new DynamicMock(typeof(IValueType));
-
ArrayList ret = new ArrayList();
DateTime date = DateTime.Now;
--- 144,147 ----
***************
*** 169,175 ****
Assertion.AssertEquals("some string", b.GetSuperString());
- mock.Verify();
}
[Test] public void CanMockOverloadedMethods()
{
--- 162,185 ----
Assertion.AssertEquals("some string", b.GetSuperString());
}
+ [Test] public void CanMockMembersWithAParamsArgument()
+ {
+ IMock mock = new DynamicMock(typeof(IWithParams));
+ mock.Expect("WithLeadingParameter", 1, new Object[] {1, 2, 3});
+
+ IWithParams p = (IWithParams)mock.MockInstance;
+ p.WithLeadingParameter(1, 1, 2, 3);
+ mock.Verify();
+ }
+ [Test] [ExpectedException(typeof(MissingMethodException))] public void CannotYetMockMembersWithOnlyAParamsArgument()
+ {
+ IMock mock = new DynamicMock(typeof(IWithParams));
+ mock.Expect("WithoutLeadingParameter", new Object[] {1, 2, 3});
+
+ IWithParams p = (IWithParams)mock.MockInstance;
+ p.WithoutLeadingParameter(1, 2, 3);
+ mock.Verify();
+ }
[Test] public void CanMockOverloadedMethods()
{
***************
*** 184,194 ****
}
! [Test] public void CanSetConstraintsInExpectations()
{
! IMock mock = new DynamicMock(typeof(SomeTestInterface));
mock.Expect("Foo", new StartsWith("Hello"));
mock.ExpectAndReturn("Bar", 5, new NotNull());
! SomeTestInterface instance = (SomeTestInterface)mock.MockInstance;
instance.Foo("Hello World");
Assertion.AssertEquals("Should get a result", 5, instance.Bar("not null"));
--- 194,204 ----
}
! [Test] public void CanMockMethodWithConstraint()
{
! IMock mock = new DynamicMock(typeof(TwoMethods));
mock.Expect("Foo", new StartsWith("Hello"));
mock.ExpectAndReturn("Bar", 5, new NotNull());
! TwoMethods instance = (TwoMethods)mock.MockInstance;
instance.Foo("Hello World");
Assertion.AssertEquals("Should get a result", 5, instance.Bar("not null"));
|
|
From: <mik...@us...> - 2003-07-30 16:35:51
|
Update of /cvsroot/nmock/nmock In directory sc8-pr-cvs1:/tmp/cvs-serv4737 Modified Files: build.bat Log Message: Adding CruiseControl.NET bootstrap build file Index: build.bat =================================================================== RCS file: /cvsroot/nmock/nmock/build.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** build.bat 14 Dec 2002 21:28:09 -0000 1.1 --- build.bat 30 Jul 2003 15:51:45 -0000 1.2 *************** *** 1,2 **** @echo off ! tools\NAnt.exe %* --- 1,2 ---- @echo off ! tools\NAnt.exe -buildfile:nmock.build %* |
|
From: <mik...@us...> - 2003-07-30 15:49:25
|
Update of /cvsroot/nmock/nmock In directory sc8-pr-cvs1:/tmp/cvs-serv4218 Added Files: continuousintegration.build .cvsignore Log Message: Adding CruiseControl.NET bootstrap build file --- NEW FILE: continuousintegration.build --- <project name="ccnetlaunch" default="go"> <target name="go" depends="update,build"/> <target name="update"> <ifnot propertyexists="cvs.executable"> <fail message="cvs.executable property not set, so can't update" /> </ifnot> <echo message="CVS Executable at [${cvs.executable}]" /> <exec basedir="." program="${cvs.executable}" commandline="-q update -P -d" /> </target> <target name="build"> <nant buildfile="nmock.build" target="cruise" inheritall="true" /> </target> </project> --- NEW FILE: .cvsignore --- build .project |
|
From: <sm...@us...> - 2003-07-30 15:02:06
|
Update of /cvsroot/nmock/nmock/test/NMock
In directory sc8-pr-cvs1:/tmp/cvs-serv27230/test/NMock
Modified Files:
DynamicMockTest.cs
Log Message:
Reformatted to make code folding in VisualStudio work better
Renamed test methods to be more descriptive
Index: DynamicMockTest.cs
===================================================================
RCS file: /cvsroot/nmock/nmock/test/NMock/DynamicMockTest.cs,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** DynamicMockTest.cs 24 Jul 2003 23:09:05 -0000 1.8
--- DynamicMockTest.cs 30 Jul 2003 15:02:03 -0000 1.9
***************
*** 6,13 ****
namespace NMock
{
!
! [TestFixture]
! public class DynamicMockTest
{
interface IBaseBlah
{
--- 6,12 ----
namespace NMock
{
! [TestFixture] public class DynamicMockTest : Assertion
{
+ #region types
interface IBaseBlah
{
***************
*** 20,29 ****
}
! [Test]
! public void DefaultDynamicMock()
{
! IMock mock = new DynamicMock(typeof(IBlah));
! Assertion.AssertEquals("MockIBlah", mock.Name);
mock.ExpectAndReturn("DoStuff", "world", "hello");
--- 19,71 ----
}
! class CustomMock : DynamicMock
{
! public CustomMock(Type t) : base(t) {}
+ public override object Call(string name, params object[] args)
+ {
+ return "CUSTOM";
+ }
+ }
+
+ class SameClass
+ {
+ public virtual string A() { return c() ? b() : "Default"; }
+ protected virtual string b() { throw new AssertionException("Should not have been called"); }
+ protected virtual bool c() { return true; }
+ }
+
+ class SameClassCaller
+ {
+ SameClass _sameClass;
+ public SameClassCaller(SameClass sc) { _sameClass = sc; }
+ public virtual string CallSameClass() { return _sameClass.A(); }
+ }
+ public class Thingy
+ {
+ public void X() {}
+ }
+
+ interface IValueType
+ {
+ ArrayList Query(string symbol, DateTime arg2);
+ }
+
+ interface IOverloadedMethods
+ {
+ void DoStuff(string one, int two);
+ void DoStuff(string one);
+ }
+
+ interface SomeTestInterface
+ {
+ void Foo(String a);
+ int Bar(String a);
+ }
+ #endregion
+
+ [Test] public void DynamicallyImplementsAnInterface()
+ {
+ IMock mock = new DynamicMock(typeof(IBlah));
mock.ExpectAndReturn("DoStuff", "world", "hello");
***************
*** 33,47 ****
mock.Verify();
}
! [Test]
! public void NamedDynamicMock()
{
IMock mock = new DynamicMock(typeof(IBlah), "XBlah");
Assertion.AssertEquals("XBlah", mock.Name);
- mock.Verify();
}
! [Test]
! public void CustomDynamicMock()
{
IMock mock = new CustomMock(typeof(IBlah));
--- 75,91 ----
mock.Verify();
}
+ [Test] public void HasADefaultNameBasedOnMockedType()
+ {
+ IMock mock = new DynamicMock(typeof(IBlah));
+ Assertion.AssertEquals("MockIBlah", mock.Name);
+ }
! [Test] public void CanBeExplicitlyNamed()
{
IMock mock = new DynamicMock(typeof(IBlah), "XBlah");
Assertion.AssertEquals("XBlah", mock.Name);
}
! [Test] public void CanBeCustomisedByOverridingCallMethod()
{
IMock mock = new CustomMock(typeof(IBlah));
***************
*** 51,164 ****
}
! private class CustomMock : DynamicMock
! {
! public CustomMock(Type t) : base(t) {}
!
! public override object Call(string name, params object[] args)
! {
! return "CUSTOM";
! }
! }
!
! [Test]
! public void MockingPartsOfSameObject()
{
DynamicMock mock = new DynamicMock(typeof(SameClass));
mock.Ignore("A");
mock.Ignore("c");
- SameClass sc = (SameClass)mock.MockInstance;
-
mock.SetupResult("b", "hello");
! Assertion.AssertEquals("hello", sc.A());
! }
!
! public class SameClass
! {
! public virtual string A()
! {
! if(c())
! {
! return b();
! }
! else
! {
! return "Default";
! }
! }
!
! protected virtual string b()
! {
! throw new Exception("Ouch");
! }
!
! protected virtual bool c()
! {
! return true;
! }
}
!
! [Test]
! public void MockingOnlyPartsOfACalledObjectWithNoExpectation()
{
DynamicMock mock = new DynamicMock(typeof(SameClass));
- mock.Ignore("A");
SameClass sc = (SameClass)mock.MockInstance;
! SomeCallingClass caller = new SomeCallingClass(sc);
mock.ExpectAndReturn("c", true);
mock.SetupResult("b", "hello");
! Assertion.AssertEquals("hello", caller.CallSomeClass());
mock.Verify();
}
! public class SomeCallingClass
! {
! SameClass _sameClass;
!
! public SomeCallingClass(SameClass sc)
! {
! _sameClass = sc;
! }
!
! public virtual string CallSomeClass()
! {
! return _sameClass.A();
! }
! }
!
! [Test]
! public void MockOfClassUsedAsExpectation()
{
! DynamicMock m1 = new DynamicMock(typeof(Thingy));
! Thingy b = (Thingy)m1.MockInstance;
Mock m2 = new Mock("x");
! m2.Expect("y", b);
! m2.Call("y", b);
m2.Verify();
}
! [Test]
! [ExpectedException(typeof(VerifyException))]
! public void MockOfClassUsedAsFailedExpectation()
{
! DynamicMock m1 = new DynamicMock(typeof(Thingy));
! Thingy b = (Thingy)m1.MockInstance;
Mock m2 = new Mock("x");
! m2.Expect("y", b);
! m2.Call("y", "something else");
! m2.Verify();
}
! [Test]
! public void ValueType()
{
IMock mock = new DynamicMock(typeof(IValueType));
! Assertion.AssertEquals("MockIValueType", mock.Name);
ArrayList ret = new ArrayList();
DateTime date = DateTime.Now;
--- 95,154 ----
}
! [Test] public void CanStubMultipleCallsToSameObject()
{
DynamicMock mock = new DynamicMock(typeof(SameClass));
mock.Ignore("A");
mock.Ignore("c");
mock.SetupResult("b", "hello");
! Assertion.AssertEquals("hello", ((SameClass)mock.MockInstance).A());
}
! [Test] public void CanSetStubsAndExpectationsOnSameObject()
{
DynamicMock mock = new DynamicMock(typeof(SameClass));
SameClass sc = (SameClass)mock.MockInstance;
! SameClassCaller caller = new SameClassCaller(sc);
!
! mock.Ignore("A");
mock.ExpectAndReturn("c", true);
mock.SetupResult("b", "hello");
! Assertion.AssertEquals("hello", caller.CallSameClass());
mock.Verify();
}
! [Test] public void MockInstanceCanBeUsedAsValueInAnExpectation()
{
! DynamicMock mockThingy = new DynamicMock(typeof(Thingy));
! Thingy thingy = (Thingy)mockThingy.MockInstance;
Mock m2 = new Mock("x");
! m2.Expect("y", thingy);
! m2.Call("y", thingy);
m2.Verify();
}
! [Test] public void ExpectationWillFailIfValueDoesntMatchMockInstance()
{
! DynamicMock mockThingy = new DynamicMock(typeof(Thingy));
! Thingy thingy = (Thingy)mockThingy.MockInstance;
Mock m2 = new Mock("x");
! m2.Expect("y", thingy);
! try
! {
! m2.Call("y", "something else");
! Fail("Should have thrown Verify Exception");
! }
! catch (VerifyException) {};
}
! [Test] public void CanExpectMultipleInputsAndReturnAValue()
{
IMock mock = new DynamicMock(typeof(IValueType));
!
ArrayList ret = new ArrayList();
DateTime date = DateTime.Now;
***************
*** 171,176 ****
}
! [Test]
! public void MockingMembersFromBaseInterfaces()
{
IMock mock = new DynamicMock(typeof(IBlah));
--- 161,165 ----
}
! [Test] public void CanMockMembersInheritedFromBaseInterfaces()
{
IMock mock = new DynamicMock(typeof(IBlah));
***************
*** 180,220 ****
Assertion.AssertEquals("some string", b.GetSuperString());
}
! interface IValueType
! {
! ArrayList Query(string symbol, DateTime arg2);
! }
!
! public class Thingy
! {
! public void X() {}
! }
!
! // [Test]
! // public void ItIsPossibleToMockMembersWithAParamsArgument()
! // {
! // IMock mock = new DynamicMock(typeof(IWithParams));
! // mock.Expect("DoStuff", new Object[] {1, 2, 3});
! //
! // IWithParams p = (IWithParams)mock.MockInstance;
! // p.DoStuff(1, 2, 3);
! //
! // mock.Verify();
! // }
! //
! // interface IWithParams
! // {
! // void DoStuff(params object[] args);
! // }
!
! interface IOverloadedMethods
! {
! void DoStuff(string one, int two);
! void DoStuff(string one);
! }
!
! [Test]
! public void CanMockOverloadedMethods()
{
IMock mock = new DynamicMock(typeof(IOverloadedMethods));
--- 169,176 ----
Assertion.AssertEquals("some string", b.GetSuperString());
+ mock.Verify();
}
! [Test] public void CanMockOverloadedMethods()
{
IMock mock = new DynamicMock(typeof(IOverloadedMethods));
***************
*** 228,233 ****
}
! [Test]
! public void CanMockMethodWithConstraint()
{
IMock mock = new DynamicMock(typeof(SomeTestInterface));
--- 184,188 ----
}
! [Test] public void CanSetConstraintsInExpectations()
{
IMock mock = new DynamicMock(typeof(SomeTestInterface));
***************
*** 242,250 ****
}
- interface SomeTestInterface
- {
- void Foo(String a);
- int Bar(String a);
- }
}
}
--- 197,200 ----
|
|
From: <sm...@us...> - 2003-07-30 15:01:32
|
Update of /cvsroot/nmock/nmock/test/NMock/Dynamic
In directory sc8-pr-cvs1:/tmp/cvs-serv27137/test/NMock/Dynamic
Modified Files:
ClassGeneratorTest.cs
Log Message:
Reformatted to make code folding in VisualStudio work better
Added CallMethodWithVariableNumberOfParams
Index: ClassGeneratorTest.cs
===================================================================
RCS file: /cvsroot/nmock/nmock/test/NMock/Dynamic/ClassGeneratorTest.cs,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** ClassGeneratorTest.cs 25 Jul 2003 15:52:41 -0000 1.9
--- ClassGeneratorTest.cs 30 Jul 2003 15:01:28 -0000 1.10
***************
*** 73,86 ****
}
! [TestFixture]
! public class ClassGeneratorTest
{
-
private ClassGenerator cg;
private IMock mock;
private IThingy thingy;
! [SetUp]
! public void SetUp()
{
cg = new ClassGenerator();
--- 73,83 ----
}
! [TestFixture] public class ClassGeneratorTest
{
private ClassGenerator cg;
private IMock mock;
private IThingy thingy;
! [SetUp] public void SetUp()
{
cg = new ClassGenerator();
***************
*** 89,94 ****
}
! [Test]
! public void CallMethodIsCalled()
{
mock.Expect("NoArgs");
--- 86,90 ----
}
! [Test] public void CallMethodIsCalled()
{
mock.Expect("NoArgs");
***************
*** 97,102 ****
}
! [Test]
! public void CallMethodWithReturn()
{
object x = "sdfs";
--- 93,97 ----
}
! [Test] public void CallMethodWithReturn()
{
object x = "sdfs";
***************
*** 107,112 ****
}
! [Test]
! public void CallMethodWithReturnAndCast()
{
string x = "sdfs";
--- 102,106 ----
}
! [Test] public void CallMethodWithReturnAndCast()
{
string x = "sdfs";
***************
*** 117,122 ****
}
! [Test]
! public void CallMethodWithWeirdObjectReturn()
{
IThingy t = thingy;
--- 111,115 ----
}
! [Test] public void CallMethodWithWeirdObjectReturn()
{
IThingy t = thingy;
***************
*** 127,132 ****
}
! [Test]
! public void CallMethodWithReturnInt()
{
mock.ExpectAndReturn("intReturn", 7);
--- 120,124 ----
}
! [Test] public void CallMethodWithReturnInt()
{
mock.ExpectAndReturn("intReturn", 7);
***************
*** 136,141 ****
}
! [Test]
! public void CallMethodWithReturnBoxings()
{
mock.ExpectAndReturn("boolReturn", true);
--- 128,132 ----
}
! [Test] public void CallMethodWithReturnBoxings()
{
mock.ExpectAndReturn("boolReturn", true);
***************
*** 146,151 ****
}
! [Test]
! public void CallMethodWithReturnEnum()
{
mock.ExpectAndReturn("getEnum", MyEnum.C);
--- 137,141 ----
}
! [Test] public void CallMethodWithReturnEnum()
{
mock.ExpectAndReturn("getEnum", MyEnum.C);
***************
*** 155,161 ****
}
! [Test]
! [ExpectedException(typeof(System.IO.IOException))]
! public void CallMethodTheThrowsException()
{
mock.ExpectAndThrow("boolReturn", new System.IO.IOException());
--- 145,149 ----
}
! [Test] [ExpectedException(typeof(System.IO.IOException))] public void CallMethodTheThrowsException()
{
mock.ExpectAndThrow("boolReturn", new System.IO.IOException());
***************
*** 163,170 ****
}
! [Test]
! public void CallMethodWithParamExpectations()
{
! mock.Expect("WithSimpleArg", new IsEqual("hello"));
thingy.WithSimpleArg("hello");
mock.Verify();
--- 151,157 ----
}
! [Test] public void CallMethodWithStringParameterExpectation()
{
! mock.Expect("WithSimpleArg", new StartsWith("he"));
thingy.WithSimpleArg("hello");
mock.Verify();
***************
*** 183,191 ****
thingy.WithIntParam(1);
mock.Verify();
! }
!
! [Test]
! [ExpectedException(typeof(VerifyException))]
! public void CallMethodWithParamExpectationsThatFails()
{
mock.Expect("WithSimpleArg", new IsEqual("hello"));
--- 170,175 ----
thingy.WithIntParam(1);
mock.Verify();
! }
! [Test] [ExpectedException(typeof(VerifyException))] public void CallMethodWithParamExpectationsThatFails()
{
mock.Expect("WithSimpleArg", new IsEqual("hello"));
***************
*** 194,199 ****
}
! [Test]
! public void CallMethodWithTwoParamExpectations()
{
mock.Expect("WithTwoArgs", new IsEqual("hello"), new IsEqual("world"));
--- 178,182 ----
}
! [Test] public void CallMethodWithTwoParamExpectations()
{
mock.Expect("WithTwoArgs", new IsEqual("hello"), new IsEqual("world"));
***************
*** 202,208 ****
}
! [Test]
! [ExpectedException(typeof(VerifyException))]
! public void CallMethodWithTwoParamExpectationsThatFails()
{
mock.Expect("WithTwoArgs", new IsEqual("hello"), new IsEqual("world"));
--- 185,189 ----
}
! [Test] [ExpectedException(typeof(VerifyException))] public void CallMethodWithTwoParamExpectationsThatFails()
{
mock.Expect("WithTwoArgs", new IsEqual("hello"), new IsEqual("world"));
***************
*** 211,216 ****
}
! [Test]
! public void CallMethodWithThreeParamExpectations()
{
mock.Expect("WithThreeArgs", new IsEqual("hello"), new IsEqual("the"), new IsEqual("world"));
--- 192,196 ----
}
! [Test] public void CallMethodWithThreeParamExpectations()
{
mock.Expect("WithThreeArgs", new IsEqual("hello"), new IsEqual("the"), new IsEqual("world"));
***************
*** 219,224 ****
}
! [Test]
! public void CallMethodWithLoadsOfParamExpectations()
{
mock.Expect("WithLotsOfArgs", new IsEqual("hello"), new IsEqual("world"), new IsEqual("is"), new IsEqual("this"), new IsEqual("the"), new IsEqual("end"));
--- 199,203 ----
}
! [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"));
***************
*** 227,232 ****
}
! [Test]
! public void CallMethodWithOtherArgs()
{
IList l = new ArrayList();
--- 206,210 ----
}
! [Test] public void CallMethodWithOtherArgs()
{
IList l = new ArrayList();
***************
*** 235,239 ****
mock.Verify();
}
!
[Test] public void CallMethodWithLongParam()
{
--- 213,222 ----
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()
{
***************
*** 243,248 ****
}
! [Test]
! public void CallReadOnlyProperty()
{
mock.ExpectAndReturn("ReadProperty", "hello");
--- 226,230 ----
}
! [Test] public void CallReadOnlyProperty()
{
mock.ExpectAndReturn("ReadProperty", "hello");
***************
*** 253,258 ****
}
! [Test]
! public void WriteOnlyPropertyExpectations()
{
mock.Expect("WriteProperty", "hello");
--- 235,239 ----
}
! [Test] public void WriteOnlyPropertyExpectations()
{
mock.Expect("WriteProperty", "hello");
***************
*** 263,268 ****
}
! [Test]
! public void ReadAndWriteProperty()
{
mock.Expect("AProperty", "hello");
--- 244,248 ----
}
! [Test] public void ReadAndWriteProperty()
{
mock.Expect("AProperty", "hello");
***************
*** 277,282 ****
}
! [Test]
! public void ExtendClass()
{
cg = new ClassGenerator();
--- 257,261 ----
}
! [Test] public void ExtendClass()
{
cg = new ClassGenerator();
***************
*** 299,310 ****
}
! [Test] [ExpectedException(typeof(TypeLoadException))]
! public void CannotMockClassWithInternalMethodBecauseOfAssemblyVisibility()
{
new ClassGenerator().Generate(typeof(ClassWithInternalMethod), mock);
}
! [Test]
! public void CheckBoxingOpCodes()
{
BoxingOpCodes opCodes = new BoxingOpCodes();
--- 278,287 ----
}
! [Test] [ExpectedException(typeof(TypeLoadException))] public void CannotMockClassWithInternalMethodBecauseOfAssemblyVisibility()
{
new ClassGenerator().Generate(typeof(ClassWithInternalMethod), mock);
}
! [Test] public void CheckBoxingOpCodes()
{
BoxingOpCodes opCodes = new BoxingOpCodes();
***************
*** 323,327 ****
Assertion.AssertEquals( OpCodes.Ldind_I1, opCodes[typeof(bool)] );
}
-
}
--- 300,303 ----
|
|
From: <sm...@us...> - 2003-07-30 14:59:28
|
Update of /cvsroot/nmock/nmock/src In directory sc8-pr-cvs1:/tmp/cvs-serv26705/src Modified Files: .cvsignore Log Message: Index: .cvsignore =================================================================== RCS file: /cvsroot/nmock/nmock/src/.cvsignore,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** .cvsignore 25 Jul 2003 15:56:55 -0000 1.3 --- .cvsignore 30 Jul 2003 14:59:24 -0000 1.4 *************** *** 3,4 **** --- 3,5 ---- src.csproj.user NMock.csproj.vspscc + NMock.csproj.user |
|
From: <sm...@us...> - 2003-07-26 23:03:52
|
Update of /cvsroot/nmock/nmock/test In directory sc8-pr-cvs1:/tmp/cvs-serv3284/test Modified Files: test.csproj Log Message: upgraded csproj files to Vs.Net 2003 Index: test.csproj =================================================================== RCS file: /cvsroot/nmock/nmock/test/test.csproj,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** test.csproj 24 Jul 2003 23:09:16 -0000 1.5 --- test.csproj 25 Jul 2003 17:14:53 -0000 1.6 *************** *** 98,101 **** --- 98,106 ---- Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}" /> + <Reference + Name = "System.Runtime.Remoting" + AssemblyName = "System.Runtime.Remoting" + HintPath = "..\..\..\WINNT\Microsoft.NET\Framework\v1.1.4322\System.Runtime.Remoting.dll" + /> </References> </Build> *************** *** 134,137 **** --- 139,152 ---- <File RelPath = "NMock\Dynamic\ClassGeneratorTest.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "NMock\Remoting\MockServerTest.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "NMock\Remoting\RemotingMockTest.cs" SubType = "Code" BuildAction = "Compile" |
|
From: cliff <pow...@ao...> - 2003-07-26 16:58:08
|
Hello,<br>
<br>
I just looked at the latest code and I don't understand why
SetupResult() takes an array of types. I has hoping to write something
like this:<br>
<br>
public interface IFoo<br>
{<br>
int GetData( string name );<br>
}<br>
public void TestSetupResult()<br>
{<br>
DynamicMock foo = new DynamicMock( typeof( IFoo ) );<br>
IFoo ifoo = (IFoo)foo.MockInstance;<br>
foo.SetupResult( "GetData", 1, "bob" );<br>
foo.SetupResult( "GetData", 2, "bill" );<br>
<br>
int answer = ifoo.GetData( "bob" ) + ifoo.GetData("bill") +
ifoo.GetData("bob")<br>
foo.Verify();<br>
}<br>
<br>
also, the following tests fail:<br>
<br>
public interface IFoo<br>
{<br>
int GetData( string name );<br>
int GetData();<br>
string [] GetArrayData();<br>
void SetArrayData( string [] data );<br>
string [] ArrayData { get;set;}<br>
}<br>
public void TestArrays()<br>
{<br>
DynamicMock foo = new DynamicMock( typeof( IFoo ) );<br>
IFoo ifoo = (IFoo)foo.MockInstance;<br>
<br>
//foo.SetupResult( "GetArrayData", new string[] { "bill",
"bar" } );<br>
foo.Expect( "SetArrayData", new string[] { "bill", "bar" }
);<br>
<br>
ifoo.SetArrayData( new String[] { "bill", "bar" } );<br>
foo.Verify();<br>
}<br>
public void TestArrays2()<br>
{<br>
DynamicMock foo = new DynamicMock( typeof( IFoo ) );<br>
IFoo ifoo = (IFoo)foo.MockInstance;<br>
<br>
foo.ExpectAndReturn( "GetArrayData", new string[] { "bill",
"bar" } );<br>
foo.Expect( "SetArrayData", new string[] { "bill", "bar" }
);<br>
<br>
ifoo.SetArrayData( ifoo.GetArrayData() );<br>
foo.Verify();<br>
}<br>
public void TestArrays3()<br>
{<br>
DynamicMock foo = new DynamicMock( typeof( IFoo ) );<br>
IFoo ifoo = (IFoo)foo.MockInstance;<br>
<br>
foo.ExpectAndReturn( "ArrayData", new string[] { "bill",
"bar" } );<br>
foo.Expect( "ArrayData", new string[] { "bill", "bar" } );<br>
<br>
ifoo.ArrayData = ifoo.ArrayData;<br>
foo.Verify();<br>
}<br>
<br>
public void TestOverload()<br>
{<br>
DynamicMock foo = new DynamicMock( typeof( IFoo ) );<br>
IFoo ifoo = (IFoo)foo.MockInstance;<br>
foo.SetupResult( "GetData", 1 );<br>
<br>
int answer = ifoo.GetData();<br>
foo.Verify();<br>
}<br>
<br>
cliff<br>
|
|
From: <sm...@us...> - 2003-07-26 10:11:06
|
Update of /cvsroot/nmock/nmock/sample In directory sc8-pr-cvs1:/tmp/cvs-serv9393/sample Added Files: .cvsignore Log Message: Added bin and obj --- NEW FILE: .cvsignore --- sample.csproj.vspscc bin obj |
|
From: <sm...@us...> - 2003-07-26 09:56:37
|
Update of /cvsroot/nmock/nmock/src/NMock/Dynamic
In directory sc8-pr-cvs1:/tmp/cvs-serv9112/src/NMock/Dynamic
Modified Files:
ClassGenerator.cs
Log Message:
Restored broken support for Longs and Remoting
Index: ClassGenerator.cs
===================================================================
RCS file: /cvsroot/nmock/nmock/src/NMock/Dynamic/ClassGenerator.cs,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** ClassGenerator.cs 24 Jul 2003 23:08:42 -0000 1.13
--- ClassGenerator.cs 25 Jul 2003 15:52:12 -0000 1.14
***************
*** 53,69 ****
AssemblyBuilder assemblyBuilder = appDomain.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run);
ModuleBuilder moduleBuilder = assemblyBuilder.DefineDynamicModule("MockModule");
! Type superClass;
! Type[] interfaces;
! if (originalType.IsInterface)
! {
! superClass = null;
! interfaces = new Type[] {originalType};
! }
! else
! {
! superClass = originalType;
! interfaces = new Type[0];
! }
! return moduleBuilder.DefineType(name, TypeAttributes.Public, superClass, interfaces);
}
--- 53,67 ----
AssemblyBuilder assemblyBuilder = appDomain.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run);
ModuleBuilder moduleBuilder = assemblyBuilder.DefineDynamicModule("MockModule");
! return moduleBuilder.DefineType(name, TypeAttributes.Public, getSuperClass(originalType), getInterfaces(originalType));
! }
!
! protected virtual Type getSuperClass(Type originalType)
! {
! return (originalType.IsInterface) ? null : originalType;
! }
!
! protected virtual Type[] getInterfaces(Type originalType)
! {
! return (originalType.IsInterface) ? new Type[] { originalType } : new Type[0];
}
***************
*** 125,133 ****
private void EmitMethodSignature(MethodInfo methodInfo, Type[] paramTypes, ILGenerator il)
{
! foreach (Type paramType in paramTypes)
! {
! il.DeclareLocal(paramType);
! }
!
il.Emit(OpCodes.Ldarg_0);
il.Emit(OpCodes.Ldfld, mockFieldBuilder);
--- 123,127 ----
private void EmitMethodSignature(MethodInfo methodInfo, Type[] paramTypes, ILGenerator il)
{
! il.DeclareLocal( typeof(object) );
il.Emit(OpCodes.Ldarg_0);
il.Emit(OpCodes.Ldfld, mockFieldBuilder);
***************
*** 175,183 ****
}
il.DeclareLocal(returnType);
! il.Emit(OpCodes.Stloc_0);
Label l = il.DefineLabel();
il.Emit(OpCodes.Br_S, l);
il.MarkLabel(l);
! il.Emit(OpCodes.Ldloc_0);
}
il.Emit(OpCodes.Ret);
--- 169,177 ----
}
il.DeclareLocal(returnType);
! il.Emit(OpCodes.Stloc_1);
Label l = il.DefineLabel();
il.Emit(OpCodes.Br_S, l);
il.MarkLabel(l);
! il.Emit(OpCodes.Ldloc_1);
}
il.Emit(OpCodes.Ret);
|
|
From: <sm...@us...> - 2003-07-26 07:22:50
|
Update of /cvsroot/nmock/nmock/src In directory sc8-pr-cvs1:/tmp/cvs-serv3284/src Modified Files: src.csproj Log Message: upgraded csproj files to Vs.Net 2003 Index: src.csproj =================================================================== RCS file: /cvsroot/nmock/nmock/src/src.csproj,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** src.csproj 13 Jul 2003 13:27:06 -0000 1.4 --- src.csproj 25 Jul 2003 17:14:53 -0000 1.5 *************** *** 2,7 **** <CSHARP ProjectType = "Local" ! ProductVersion = "7.0.9466" ! SchemaVersion = "1.0" ProjectGuid = "{4859B9E5-3F65-4517-878C-AFC58B9D0035}" > --- 2,7 ---- <CSHARP ProjectType = "Local" ! ProductVersion = "7.10.3077" ! SchemaVersion = "2.0" ProjectGuid = "{4859B9E5-3F65-4517-878C-AFC58B9D0035}" > *************** *** 17,21 **** --- 17,24 ---- DelaySign = "false" OutputType = "Library" + PreBuildEvent = "" + PostBuildEvent = "" RootNamespace = "" + RunPostBuildEvent = "OnBuildSuccess" StartupObject = "" > *************** *** 31,34 **** --- 34,39 ---- FileAlignment = "4096" IncrementalBuild = "true" + NoStdLib = "false" + NoWarn = "" Optimize = "false" OutputPath = "bin\Debug\" *************** *** 49,52 **** --- 54,59 ---- FileAlignment = "4096" IncrementalBuild = "false" + NoStdLib = "false" + NoWarn = "" Optimize = "true" OutputPath = "bin\Release\" *************** *** 79,82 **** --- 86,94 ---- <File RelPath = "AssemblyInfo.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "NMock\CallMethodWithoutExpectation.cs" SubType = "Code" BuildAction = "Compile" |
|
From: <sm...@us...> - 2003-07-26 06:22:32
|
Update of /cvsroot/nmock/nmock/test In directory sc8-pr-cvs1:/tmp/cvs-serv10277/test Modified Files: .cvsignore Log Message: Added VisualStudio stuff Index: .cvsignore =================================================================== RCS file: /cvsroot/nmock/nmock/test/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** .cvsignore 13 Jul 2003 21:36:07 -0000 1.2 --- .cvsignore 25 Jul 2003 15:58:02 -0000 1.3 *************** *** 2,3 **** --- 2,4 ---- obj test.csproj.user + test.csproj.vspscc |
|
From: <sm...@us...> - 2003-07-26 06:22:27
|
Update of /cvsroot/nmock/nmock/src In directory sc8-pr-cvs1:/tmp/cvs-serv10075/src Modified Files: .cvsignore Log Message: Added VisualStudio stuff Index: .cvsignore =================================================================== RCS file: /cvsroot/nmock/nmock/src/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** .cvsignore 13 Jul 2003 21:36:07 -0000 1.2 --- .cvsignore 25 Jul 2003 15:56:55 -0000 1.3 *************** *** 2,3 **** --- 2,4 ---- obj src.csproj.user + NMock.csproj.vspscc |
|
From: <sm...@us...> - 2003-07-26 06:22:21
|
Update of /cvsroot/nmock/nmock/sample In directory sc8-pr-cvs1:/tmp/cvs-serv9501/sample Modified Files: .cvsignore Log Message: Added csproj.user Index: .cvsignore =================================================================== RCS file: /cvsroot/nmock/nmock/sample/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** .cvsignore 25 Jul 2003 15:53:51 -0000 1.1 --- .cvsignore 25 Jul 2003 15:54:12 -0000 1.2 *************** *** 2,3 **** --- 2,4 ---- bin obj + sample.csproj.user |