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: <sm...@us...> - 2003-08-13 20:09:04
|
Update of /cvsroot/nmock/nmock/test/NMock
In directory sc8-pr-cvs1:/tmp/cvs-serv30014/test/NMock
Modified Files:
MockTest.cs
Log Message:
Added IInvocationHandler and generalised DynamicProxy generation
(with Jon Tirsen)
Index: MockTest.cs
===================================================================
RCS file: /cvsroot/nmock/nmock/test/NMock/MockTest.cs,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** MockTest.cs 8 Aug 2003 00:05:03 -0000 1.9
--- MockTest.cs 13 Aug 2003 19:42:39 -0000 1.10
***************
*** 9,13 ****
{
! private IMock mock;
[SetUp] public void SetUp()
--- 9,13 ----
{
! private Mock mock;
[SetUp] public void SetUp()
|
|
From: Mike R. <mi...@th...> - 2003-08-13 20:01:20
|
Hi, Would anyone like me to setup mail for CruiseControl? One option is to create 2 mailing lists on the SF project one of which CCNet can send all build events to, and one of which it can send just 'status change' events to. If you want to go with this kind of thing, an admin will need to create the mailing lists. Let me know what you want to do, if anything. Mike -- Mike Roberts http://mikeroberts.thoughtworks.net/ |
|
From: <sm...@us...> - 2003-08-13 19:47:14
|
Update of /cvsroot/nmock/nmock/src/NMock
In directory sc8-pr-cvs1:/tmp/cvs-serv30014/src/NMock
Modified Files:
IMock.cs
Added Files:
IInvocationHandler.cs
Log Message:
Added IInvocationHandler and generalised DynamicProxy generation
(with Jon Tirsen)
--- NEW FILE: IInvocationHandler.cs ---
namespace NMock
{
public interface IInvocationHandler
{
/// <summary>
/// Make a call to a mocked up method name to check it meets its expectations.
/// </summary>
object Call(string methodName, params object[] args);
}
}
Index: IMock.cs
===================================================================
RCS file: /cvsroot/nmock/nmock/src/NMock/IMock.cs,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** IMock.cs 24 Jul 2003 23:08:42 -0000 1.4
--- IMock.cs 13 Aug 2003 19:42:38 -0000 1.5
***************
*** 8,12 ****
/// </summary>
/// <see cref="Mock"/>
! public interface IMock : IVerifiable
{
/// <summary>
--- 8,12 ----
/// </summary>
/// <see cref="Mock"/>
! public interface IMock : IInvocationHandler, IVerifiable
{
/// <summary>
***************
*** 54,63 ****
/// </summary>
void SetupResult(string methodName, object returnVal, params Type[] argTypes);
-
-
- /// <summary>
- /// Make a call to a mocked up method name to check it meets its expectations.
- /// </summary>
- object Call(string methodName, params object[] args);
}
--- 54,57 ----
|
|
From: <sm...@us...> - 2003-08-13 19:44:41
|
Update of /cvsroot/nmock/nmock/test/NMock/Dynamic
In directory sc8-pr-cvs1:/tmp/cvs-serv30014/test/NMock/Dynamic
Modified Files:
ClassGeneratorTest.cs
Log Message:
Added IInvocationHandler and generalised DynamicProxy generation
(with Jon Tirsen)
Index: ClassGeneratorTest.cs
===================================================================
RCS file: /cvsroot/nmock/nmock/test/NMock/Dynamic/ClassGeneratorTest.cs,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** ClassGeneratorTest.cs 30 Jul 2003 17:28:01 -0000 1.11
--- ClassGeneratorTest.cs 13 Aug 2003 19:42:37 -0000 1.12
***************
*** 78,81 ****
--- 78,106 ----
#endregion
+ [TestFixture] public class ClassGeneratorInvocationHandlerTest
+ {
+ public class InvocationHandlerImpl : IInvocationHandler
+ {
+ public string invokedMethodName;
+ public object[] invokedArgs;
+
+ public object Call(string methodName, params object[] args)
+ {
+ invokedMethodName = methodName;
+ invokedArgs = args;
+ return null;
+ }
+ }
+
+ [Test] public void CreateGenericProxy()
+ {
+ ClassGenerator cg = new ClassGenerator();
+ InvocationHandlerImpl handler = new InvocationHandlerImpl();
+ IThingy thingy = (IThingy)cg.Generate(typeof(IThingy), handler);
+ thingy.NoArgs();
+ Assertion.AssertEquals("NoArgs", handler.invokedMethodName);
+ }
+ }
+
[TestFixture] public class ClassGeneratorTest
{
***************
*** 337,340 ****
}
-
}
--- 362,364 ----
|
|
From: <sm...@us...> - 2003-08-13 19:44:41
|
Update of /cvsroot/nmock/nmock/src
In directory sc8-pr-cvs1:/tmp/cvs-serv30014/src
Modified Files:
src.csproj
Log Message:
Added IInvocationHandler and generalised DynamicProxy generation
(with Jon Tirsen)
Index: src.csproj
===================================================================
RCS file: /cvsroot/nmock/nmock/src/src.csproj,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** src.csproj 8 Aug 2003 00:05:03 -0000 1.6
--- src.csproj 13 Aug 2003 19:42:39 -0000 1.7
***************
*** 100,103 ****
--- 100,108 ----
/>
<File
+ RelPath = "NMock\IInvocationHandler.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
RelPath = "NMock\IMethod.cs"
SubType = "Code"
|
|
From: Vaughn, C. <Va...@va...> - 2003-08-08 12:36:22
|
I appreciate it, thanx. -----Original Message----- From: Steve Freeman [mailto:st...@m3...] Sent: Thursday, August 07, 2003 8:06 PM To: Vaughn, Clifton Cc: Nmock-General (E-mail) Subject: Re: [Nmock-general] Enhancement request: VerifyException.Reason Done. I used the opportunity to add a little more structure. S Vaughn, Clifton wrote: > Since I use a lot of mocks, sometimes it's tricky to figure out which one > gave an error. I'd like to have the mock name added to the error message > before the method name. Here's my version of MockTest with changes to the > test for e.Reason: |
|
From: Steve F. <st...@m3...> - 2003-08-08 00:06:45
|
Done. I used the opportunity to add a little more structure. S Vaughn, Clifton wrote: > Since I use a lot of mocks, sometimes it's tricky to figure out which one > gave an error. I'd like to have the mock name added to the error message > before the method name. Here's my version of MockTest with changes to the > test for e.Reason: |
|
From: <sm...@us...> - 2003-08-08 00:05:08
|
Update of /cvsroot/nmock/nmock/src/NMock
In directory sc8-pr-cvs1:/tmp/cvs-serv5316/src/NMock
Modified Files:
Mock.cs DynamicMock.cs MockCall.cs Method.cs
Added Files:
Invocation.cs MethodSignature.cs
Log Message:
Added Invocation and MethodSignature to collect data values together.
Include type name in error reports
Tidied up MockTest.
--- NEW FILE: Invocation.cs ---
using System;
namespace NMock
{
/// <summary>
/// Name and argument details of an attempted call of a method
/// </summary>
public class Invocation
{
public readonly string methodName;
public readonly object[] arguments;
public Invocation(string methodName, object[] arguments)
{
this.methodName = methodName;
this.arguments = arguments;
}
}
}
--- NEW FILE: MethodSignature.cs ---
using System;
namespace NMock
{
public class MethodSignature
{
public readonly string typeName;
public readonly string methodName;
public readonly Type[] argumentTypes;
public MethodSignature(string typeName, string methodName, Type[] argumentTypes)
{
this.typeName = typeName;
this.methodName = methodName;
this.argumentTypes = argumentTypes;
}
public override string ToString()
{
return typeName + "." + methodName + "()";
}
}
}
Index: Mock.cs
===================================================================
RCS file: /cvsroot/nmock/nmock/src/NMock/Mock.cs,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** Mock.cs 25 Jul 2003 15:52:11 -0000 1.10
--- Mock.cs 8 Aug 2003 00:05:02 -0000 1.11
***************
*** 44,66 ****
public virtual void ExpectNoCall(string methodName, params Type[] argTypes)
{
! addExpectation(methodName, new MockNoCall(argTypes));
}
public virtual void ExpectAndReturn(string methodName, object result, params object[] args)
{
! addExpectation(methodName, new MockCall(result, null, args));
}
public virtual void ExpectAndThrow(string methodName, Exception e, params object[] args)
{
! addExpectation(methodName, new MockCall(null, e, args));
}
private void addExpectation(string methodName, MockCall call)
{
! IMethod method = getMethod(methodName, call.ArgTypes);
if (method == null)
{
! method = new Method(methodName);
methods[methodName] = method;
}
--- 44,69 ----
public virtual void ExpectNoCall(string methodName, params Type[] argTypes)
{
! addExpectation(methodName, new MockNoCall(new MethodSignature(Name, methodName, argTypes)));
}
public virtual void ExpectAndReturn(string methodName, object result, params object[] args)
{
! addExpectation(methodName,
! new MockCall(new MethodSignature(Name, methodName, MockCall.GetArgTypes(args)), result, null, args));
}
public virtual void ExpectAndThrow(string methodName, Exception e, params object[] args)
{
! addExpectation(methodName,
! new MockCall(new MethodSignature(Name, methodName, MockCall.GetArgTypes(args)), null, e, args));
}
private void addExpectation(string methodName, MockCall call)
{
! MethodSignature signature = new MethodSignature(Name, methodName, call.ArgTypes);
! IMethod method = getMethod(signature);
if (method == null)
{
! method = new Method(signature);
methods[methodName] = method;
}
***************
*** 70,74 ****
public virtual void SetupResult(string methodName, object returnVal, params Type[] argTypes)
{
! IMethod method = getMethod(methodName, argTypes);
if (method == null)
{
--- 73,77 ----
public virtual void SetupResult(string methodName, object returnVal, params Type[] argTypes)
{
! IMethod method = getMethod(new MethodSignature(Name, methodName, argTypes));
if (method == null)
{
***************
*** 76,86 ****
methods[methodName] = method;
}
! method.SetExpectation(new MockCall( returnVal, null, null));
}
public virtual object Call(string methodName, params object[] args)
{
! Type[] argTypes = MockCall.GetArgTypes(args);
! IMethod method = getMethod(methodName, argTypes);
if (method == null)
{
--- 79,89 ----
methods[methodName] = method;
}
! method.SetExpectation(new MockCall(new MethodSignature(Name, methodName, argTypes), returnVal, null, null));
}
public virtual object Call(string methodName, params object[] args)
{
! MethodSignature signature = new MethodSignature(Name, methodName, MockCall.GetArgTypes(args));
! IMethod method = getMethod(signature);
if (method == null)
{
***************
*** 102,108 ****
}
! protected virtual IMethod getMethod(string methodName, Type[] argTypes)
{
! return (IMethod)methods[methodName];
}
--- 105,111 ----
}
! protected virtual IMethod getMethod(MethodSignature signature)
{
! return (IMethod)methods[signature.methodName];
}
Index: DynamicMock.cs
===================================================================
RCS file: /cvsroot/nmock/nmock/src/NMock/DynamicMock.cs,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** DynamicMock.cs 3 Aug 2003 22:42:47 -0000 1.13
--- DynamicMock.cs 8 Aug 2003 00:05:03 -0000 1.14
***************
*** 53,66 ****
}
! protected override IMethod getMethod(string methodName, Type[] argTypes)
{
! checkMethodIsValidIfNoConstraints(methodName, argTypes);
! return base.getMethod(methodName, argTypes);
}
public override void SetupResult(string methodName, object returnVal, params Type[] argTypes)
{
! checkMethodIsValidIfNoConstraints(methodName, argTypes);
checkReturnTypeIsValid(methodName, returnVal);
base.SetupResult(methodName, returnVal, argTypes);
--- 53,67 ----
}
! protected override IMethod getMethod(MethodSignature signature)
{
! checkMethodIsValidIfNoConstraints(signature);
! return base.getMethod(signature);
}
public override void SetupResult(string methodName, object returnVal, params Type[] argTypes)
{
! MethodSignature signature = new MethodSignature(Name, methodName, argTypes);
! checkMethodIsValidIfNoConstraints(signature);
checkReturnTypeIsValid(methodName, returnVal);
base.SetupResult(methodName, returnVal, argTypes);
***************
*** 96,102 ****
}
! void checkMethodIsValidIfNoConstraints(string methodName, Type[] argTypes)
{
! foreach(Type argType in argTypes)
{
if(typeof(IConstraint).IsAssignableFrom(argType)) return;
--- 97,103 ----
}
! void checkMethodIsValidIfNoConstraints(MethodSignature signature)
{
! foreach(Type argType in signature.argumentTypes)
{
if(typeof(IConstraint).IsAssignableFrom(argType)) return;
***************
*** 106,112 ****
foreach (Type t in allTypes)
{
! MethodInfo method = t.GetMethod(methodName, ClassGenerator.ALL_INSTANCE_METHODS, null,
! argTypes, null);
! PropertyInfo property = t.GetProperty(methodName, ClassGenerator.ALL_INSTANCE_METHODS);
if (property != null)
{
--- 107,113 ----
foreach (Type t in allTypes)
{
! MethodInfo method = t.GetMethod(signature.methodName, ClassGenerator.ALL_INSTANCE_METHODS, null,
! signature.argumentTypes, null);
! PropertyInfo property = t.GetProperty(signature.methodName, ClassGenerator.ALL_INSTANCE_METHODS);
if (property != null)
{
***************
*** 117,126 ****
if(!method.IsVirtual)
{
! throw new ArgumentException(String.Format("method <{0}> is not virtual", methodName));
}
return;
}
}
! throw new MissingMethodException(String.Format("method <{0}> not defined", methodName));
}
--- 118,127 ----
if(!method.IsVirtual)
{
! throw new ArgumentException(String.Format("method <{0}> is not virtual", signature.methodName));
}
return;
}
}
! throw new MissingMethodException(String.Format("method <{0}> not defined", signature.methodName));
}
Index: MockCall.cs
===================================================================
RCS file: /cvsroot/nmock/nmock/src/NMock/MockCall.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** MockCall.cs 24 Jul 2003 23:08:42 -0000 1.3
--- MockCall.cs 8 Aug 2003 00:05:03 -0000 1.4
***************
*** 6,20 ****
public class MockCall
{
! protected Type[] argTypes;
private IConstraint[] expectedArgs;
private object returnValue;
private Exception e;
! public MockCall(object returnValue, Exception e, object[] expectedArgs)
{
! this.argTypes = argsAsTypes(expectedArgs);
! this.expectedArgs = argsAsConstraints(expectedArgs);
this.returnValue = returnValue;
this.e = e;
}
--- 6,20 ----
public class MockCall
{
! protected MethodSignature signature;
private IConstraint[] expectedArgs;
private object returnValue;
private Exception e;
! public MockCall(MethodSignature signature, object returnValue, Exception e, object[] expectedArgs)
{
! this.signature = signature;
this.returnValue = returnValue;
this.e = e;
+ this.expectedArgs = argsAsConstraints(expectedArgs);
}
***************
*** 24,39 ****
}
! public Type[] ArgTypes
! {
! get
! {
! return argTypes;
! }
! }
!
! private Type[] argsAsTypes(object[] args)
! {
! return MockCall.GetArgTypes(args);
! }
private IConstraint[] argsAsConstraints(object[] args)
--- 24,28 ----
}
! public Type[] ArgTypes { get {return signature.argumentTypes; } }
private IConstraint[] argsAsConstraints(object[] args)
***************
*** 124,135 ****
public class MockNoCall : MockCall
{
! public MockNoCall(Type[] argTypes) : base(null, null, null)
{
- this.argTypes = argTypes;
}
public override object Call(string methodName, object[] actualArgs)
{
! throw new VerifyException(methodName + "() called", 0, 1);
}
}
--- 113,123 ----
public class MockNoCall : MockCall
{
! public MockNoCall(MethodSignature signature) : base(signature, null, null, null)
{
}
public override object Call(string methodName, object[] actualArgs)
{
! throw new VerifyException(signature.ToString() + " called", 0, 1);
}
}
Index: Method.cs
===================================================================
RCS file: /cvsroot/nmock/nmock/src/NMock/Method.cs,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Method.cs 13 Mar 2003 22:22:11 -0000 1.4
--- Method.cs 8 Aug 2003 00:05:03 -0000 1.5
***************
*** 8,24 ****
private static object NO_RETURN_VALUE = new object();
! private string name;
private int timesCalled = 0;
private CallSequence expectations;
! public Method(string aName)
{
! name = aName;
! expectations = new CallSequence(aName);
}
public virtual string Name
{
! get { return name; }
}
--- 8,24 ----
private static object NO_RETURN_VALUE = new object();
! private MethodSignature signature;
private int timesCalled = 0;
private CallSequence expectations;
! public Method(MethodSignature signature)
{
! this.signature = signature;
! expectations = new CallSequence(signature.methodName);
}
public virtual string Name
{
! get { return signature.methodName; }
}
***************
*** 37,46 ****
MockCall mockCall = expectations[timesCalled];
timesCalled++;
! return mockCall.Call(name, parameters);
}
public virtual void Verify()
{
! Mock.Assertion.AssertEquals(name + "() " + CallCountErrorMessage(),
expectations.CountExpectedCalls, timesCalled);
}
--- 37,46 ----
MockCall mockCall = expectations[timesCalled];
timesCalled++;
! return mockCall.Call(signature.methodName, parameters);
}
public virtual void Verify()
{
! Mock.Assertion.AssertEquals(signature + " " + CallCountErrorMessage(),
expectations.CountExpectedCalls, timesCalled);
}
***************
*** 67,71 ****
get
{
! if (sequence.Count == timesCalled)
{
throw new VerifyException(name + "() called too many times", sequence.Count, timesCalled + 1);
--- 67,71 ----
get
{
! if (sequence.Count <= timesCalled)
{
throw new VerifyException(name + "() called too many times", sequence.Count, timesCalled + 1);
***************
*** 84,90 ****
{
int count = 0;
! for (int i = 0; i < sequence.Count; i++)
{
! if (! (sequence[i] is MockNoCall))
{
count++;
--- 84,90 ----
{
int count = 0;
! foreach (Object mockCall in sequence)
{
! if (! (mockCall is MockNoCall))
{
count++;
|
|
From: <sm...@us...> - 2003-08-08 00:05:06
|
Update of /cvsroot/nmock/nmock/test/NMock
In directory sc8-pr-cvs1:/tmp/cvs-serv5316/test/NMock
Modified Files:
DynamicMockTest.cs MockTest.cs
Log Message:
Added Invocation and MethodSignature to collect data values together.
Include type name in error reports
Tidied up MockTest.
Index: DynamicMockTest.cs
===================================================================
RCS file: /cvsroot/nmock/nmock/test/NMock/DynamicMockTest.cs,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** DynamicMockTest.cs 3 Aug 2003 23:01:22 -0000 1.13
--- DynamicMockTest.cs 8 Aug 2003 00:05:03 -0000 1.14
***************
*** 248,253 ****
}
!
! [Test] [Ignore("SetupResult doesn't work for properties")] public void SetAndGetPropertiesDoesNotWorkWithSetupReturn()
{
DynamicMock mock = new DynamicMock(typeof(IWithProperty));
--- 248,253 ----
}
! [Ignore("SetupResult doesn't work for properties")]
! [Test] public void SetAndGetPropertiesDoesNotWorkWithSetupReturn()
{
DynamicMock mock = new DynamicMock(typeof(IWithProperty));
***************
*** 255,259 ****
mock.SetupResult("Name", "fred");
! mock.ExpectAndReturn("Name", "jim");
AssertEquals("Should be property Name", "fred", withProperty.Name);
--- 255,259 ----
mock.SetupResult("Name", "fred");
! mock.Expect("Name", "jim");
AssertEquals("Should be property Name", "fred", withProperty.Name);
Index: MockTest.cs
===================================================================
RCS file: /cvsroot/nmock/nmock/test/NMock/MockTest.cs,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** MockTest.cs 24 Jul 2003 23:09:05 -0000 1.8
--- MockTest.cs 8 Aug 2003 00:05:03 -0000 1.9
***************
*** 1,2 ****
--- 1,3 ----
+ using System;
using NUnit.Framework;
using NMock.Constraints;
***************
*** 5,34 ****
{
! [TestFixture]
! public class MockTest
{
private IMock mock;
! [SetUp]
! public void SetUp()
{
mock = new Mock("mymock");
}
! [Test]
! public void Name()
{
Assertion.AssertEquals("mymock", mock.Name);
}
! [Test]
! public void NewMockVerifies()
{
mock.Verify();
}
! [Test]
! public void CallToVoidMethod()
{
mock.Expect("myMethod");
--- 6,30 ----
{
! [TestFixture] public class MockTest : Assertion
{
private IMock mock;
! [SetUp] public void SetUp()
{
mock = new Mock("mymock");
}
! [Test] public void HasNameSetDuringConstruction()
{
Assertion.AssertEquals("mymock", mock.Name);
}
! [Test] public void VerifyiDoesNothingWithANewMock()
{
mock.Verify();
}
! [Test] public void ExpectAndCallAVoidMethod()
{
mock.Expect("myMethod");
***************
*** 37,43 ****
}
! [Test]
! [ExpectedException(typeof(VerifyException))]
! public void NoCallToVoidMethod()
{
mock.Expect("myMethod");
--- 33,37 ----
}
! [Test] [ExpectedException(typeof(VerifyException))] public void VerifyFailsWhenAnExpectedVoidMethodIsNotCalled()
{
mock.Expect("myMethod");
***************
*** 45,51 ****
}
! [Test]
! [ExpectedException(typeof(VerifyException))]
! public void TooManyCallsToVoidMethod()
{
mock.Expect("myMethod");
--- 39,43 ----
}
! [Test] [ExpectedException(typeof(VerifyException))] public void VerifyFailsWhenTooManyCallsToAnExpectedVoidMethod()
{
mock.Expect("myMethod");
***************
*** 54,59 ****
}
! [Test]
! public void CallWithNoExpectation()
{
mock.Call("myMethod");
--- 46,50 ----
}
! [Test] public void IgnoresUnexpectedCalls()
{
mock.Call("myMethod");
***************
*** 61,66 ****
}
! [Test]
! public void ManyCallsToVoidMethod()
{
mock.Expect("myMethod");
--- 52,56 ----
}
! [Test] public void VerifyMultipleCallsToSameExpectedVoidMethod()
{
mock.Expect("myMethod");
***************
*** 73,78 ****
}
! [Test]
! public void CallToMethodWithParams()
{
mock.Expect("myMethod", new IsEqual("hello"), new IsAnything());
--- 63,77 ----
}
! [Test] [ExpectedException(typeof(VerifyException))] public void VerifyFailsForDifferentNumberOfCallsToExpectedVoidMethod()
! {
! mock.Expect("myMethod");
! mock.Expect("myMethod");
! mock.Expect("myMethod");
! mock.Call("myMethod");
! mock.Call("myMethod");
! mock.Verify();
! }
!
! [Test] public void CallToMethodWithParameterConstraints()
{
mock.Expect("myMethod", new IsEqual("hello"), new IsAnything());
***************
*** 81,87 ****
}
! [Test]
! [ExpectedException(typeof(VerifyException))]
! public void CallToMethodWithInvalidParams()
{
mock.Expect("myMethod", new IsEqual("hello"), new IsAnything());
--- 80,84 ----
}
! [Test] [ExpectedException(typeof(VerifyException))] public void CallToMethodWithInvalidParams()
{
mock.Expect("myMethod", new IsEqual("hello"), new IsAnything());
***************
*** 89,94 ****
}
! [Test]
! public void CallToMethodWithParamsButNotCheckingValues()
{
mock.Expect("myMethod");
--- 86,90 ----
}
! [Test] public void CallToMethodWithParamsButNotCheckingValues()
{
mock.Expect("myMethod");
***************
*** 97,102 ****
}
! [Test]
! public void CallMultipleMethods()
{
mock.Expect("myMethod1");
--- 93,97 ----
}
! [Test] public void CallMultipleMethods()
{
mock.Expect("myMethod1");
***************
*** 109,114 ****
}
! [Test]
! public void CallMultipleMethodsInDifferentOrder()
{
mock.Expect("myMethod1");
--- 104,108 ----
}
! [Test] public void CallMultipleMethodsInDifferentOrder()
{
mock.Expect("myMethod1");
***************
*** 121,126 ****
}
! [Test]
! public void CallMultipleMethodsSomeWithoutExpectations()
{
mock.Expect("myMethod1");
--- 115,119 ----
}
! [Test] public void CallMultipleMethodsSomeWithoutExpectations()
{
mock.Expect("myMethod1");
***************
*** 135,140 ****
}
! [Test]
! public void CallToNonVoidMethod()
{
object something = new object();
--- 128,132 ----
}
! [Test] public void CallToNonVoidMethod()
{
object something = new object();
***************
*** 145,150 ****
}
! [Test]
! public void CallToNonVoidMethodWithParams()
{
object something = new object();
--- 137,141 ----
}
! [Test] public void CallToNonVoidMethodWithParams()
{
object something = new object();
***************
*** 155,161 ****
}
! [Test]
! [ExpectedException(typeof(VerifyException))]
! public void CallToNonVoidMethodWithWrongParams()
{
object something = new object();
--- 146,150 ----
}
! [Test] [ExpectedException(typeof(VerifyException))] public void CallToNonVoidMethodWithWrongParams()
{
object something = new object();
***************
*** 166,171 ****
}
! [Test]
! public void MultipleCallToNonVoidMethod()
{
object something = new object();
--- 155,159 ----
}
! [Test] public void MultipleCallToNonVoidMethod()
{
object something = new object();
***************
*** 181,186 ****
}
! [Test]
! public void CallToNonVoidMethodReturningNull()
{
mock.ExpectAndReturn("myMethod", null);
--- 169,173 ----
}
! [Test] public void CallToNonVoidMethodReturningNull()
{
mock.ExpectAndReturn("myMethod", null);
***************
*** 189,194 ****
}
! [Test]
! public void DefaultEqualsConstraint()
{
object o = new object();
--- 176,180 ----
}
! [Test] public void DefaultEqualsConstraint()
{
object o = new object();
***************
*** 197,203 ****
}
! [Test]
! [ExpectedException(typeof(VerifyException))]
! public void DefaultEqualsConstraintFailure()
{
mock.Expect("myMethod", new object());
--- 183,187 ----
}
! [Test] [ExpectedException(typeof(VerifyException))] public void DefaultEqualsConstraintFailure()
{
mock.Expect("myMethod", new object());
***************
*** 205,210 ****
}
! [Test]
! public void DefaultAnythingConstraint()
{
mock.Expect("myMethod", null, null);
--- 189,193 ----
}
! [Test] public void DefaultAnythingConstraint()
{
mock.Expect("myMethod", null, null);
***************
*** 216,221 ****
}
! [Test]
! public void FixedValue()
{
mock.SetupResult("myMethod", "hello");
--- 199,203 ----
}
! [Test] public void FixedValue()
{
mock.SetupResult("myMethod", "hello");
***************
*** 237,243 ****
}
! [Test]
! [ExpectedException(typeof(System.IO.IOException))]
! public void CallThrowingException()
{
mock.ExpectAndThrow("myMethod", new System.IO.IOException());
--- 219,223 ----
}
! [Test] [ExpectedException(typeof(System.IO.IOException))] public void CallThrowingException()
{
mock.ExpectAndThrow("myMethod", new System.IO.IOException());
***************
*** 245,251 ****
}
! [Test]
! [ExpectedException(typeof(VerifyException))]
! public void ExpectNoCall()
{
mock.ExpectNoCall("myMethod");
--- 225,229 ----
}
! [Test] [ExpectedException(typeof(VerifyException))] public void ExpectNoCall()
{
mock.ExpectNoCall("myMethod");
***************
*** 253,258 ****
}
! [Test] // , Ignore("NoCall does not currently work, but requires a biggish overhaul to fix. No time right now to do it")]
! public void ExpectNoCall_WithNoCall()
{
mock.ExpectNoCall("myMethod");
--- 231,236 ----
}
! // , Ignore("NoCall does not currently work, but requires a biggish overhaul to fix. No time right now to do it")]
! [Test] public void ExpectNoCall_WithNoCall()
{
mock.ExpectNoCall("myMethod");
***************
*** 260,266 ****
}
! [Test]
! [ExpectedException(typeof(VerifyException))]
! public void Strict()
{
mock.Strict = true;
--- 238,242 ----
}
! [Test] [ExpectedException(typeof(VerifyException))] public void Strict()
{
mock.Strict = true;
***************
*** 272,287 ****
}
! [Test]
! public void ExpectedNoCallsMessage()
{
try
{
mock.ExpectNoCall("x");
! mock.Call("x");
! Assertion.Fail("Expected VerifyException");
}
catch (VerifyException e)
{
! Assertion.AssertEquals("x() called", e.Reason);
Assertion.AssertEquals(0, e.Expected);
Assertion.AssertEquals(1, e.Actual);
--- 248,262 ----
}
! [Test] public void UnexpectedMethodCallVerifyExceptionMessage()
{
try
{
mock.ExpectNoCall("x");
! mock.Call("x");
! Fail("Expected VerifyException");
}
catch (VerifyException e)
{
! Assertion.AssertEquals("mymock.x() called", e.Reason);
Assertion.AssertEquals(0, e.Expected);
Assertion.AssertEquals(1, e.Actual);
***************
*** 289,294 ****
}
! [Test]
! public void ExpectedOneCallMessage()
{
try
--- 264,268 ----
}
! [Test] public void MethodNotCalledVerifyExpectionMessage()
{
try
***************
*** 300,304 ****
catch (VerifyException e)
{
! Assertion.AssertEquals("x() never called", e.Reason);
Assertion.AssertEquals(1, e.Expected);
Assertion.AssertEquals(0, e.Actual);
--- 274,278 ----
catch (VerifyException e)
{
! Assertion.AssertEquals("mymock.x() never called", e.Reason);
Assertion.AssertEquals(1, e.Expected);
Assertion.AssertEquals(0, e.Actual);
***************
*** 306,311 ****
}
! [Test]
! public void ExpectedOneCallGotTooManyMessage()
{
try
--- 280,284 ----
}
! [Test] public void ExpectedOneCallGotTooManyMessage()
{
try
***************
*** 325,330 ****
}
! [Test]
! public void ExpectedManyCallsGotNoneMessage()
{
try
--- 298,302 ----
}
! [Test] public void ExpectedManyCallsGotNoneMessage()
{
try
***************
*** 337,348 ****
catch (VerifyException e)
{
! Assertion.AssertEquals("x() never called", e.Reason);
! Assertion.AssertEquals(2, e.Expected);
! Assertion.AssertEquals(0, e.Actual);
}
}
! [Test]
! public void ExpectedManyCallsGotOneMessage()
{
try
--- 309,319 ----
catch (VerifyException e)
{
! AssertEquals("mymock.x() never called", e.Reason);
! AssertEquals(2, e.Expected);
! AssertEquals(0, e.Actual);
}
}
! [Test] public void ExpectedManyCallsGotOneMessage()
{
try
***************
*** 356,360 ****
catch (VerifyException e)
{
! Assertion.AssertEquals("x() not called enough times", e.Reason);
Assertion.AssertEquals(2, e.Expected);
Assertion.AssertEquals(1, e.Actual);
--- 327,331 ----
catch (VerifyException e)
{
! Assertion.AssertEquals("mymock.x() not called enough times", e.Reason);
Assertion.AssertEquals(2, e.Expected);
Assertion.AssertEquals(1, e.Actual);
***************
*** 362,367 ****
}
! [Test]
! public void ExpectedManyCallsGotTooManyMessage()
{
try
--- 333,337 ----
}
! [Test] public void ExpectedManyCallsGotTooManyMessage()
{
try
***************
*** 383,388 ****
}
! [Test]
! public void ExpectedManyCallsGotNotEnoughMessage()
{
try
--- 353,357 ----
}
! [Test] public void ExpectedManyCallsGotNotEnoughMessage()
{
try
***************
*** 400,409 ****
Assertion.AssertEquals(3, e.Expected);
Assertion.AssertEquals(2, e.Actual);
! Assertion.AssertEquals("x() not called enough times", e.Reason);
}
}
! [Test]
! public void IncorrectNumberOfParametersMessage()
{
try
--- 369,377 ----
Assertion.AssertEquals(3, e.Expected);
Assertion.AssertEquals(2, e.Actual);
! Assertion.AssertEquals("mymock.x() not called enough times", e.Reason);
}
}
! [Test] public void IncorrectNumberOfParametersMessage()
{
try
***************
*** 421,426 ****
}
! [Test]
! public void IncorrectParameterConstraintMessage()
{
try
--- 389,393 ----
}
! [Test] public void IncorrectParameterConstraintMessage()
{
try
***************
*** 441,455 ****
}
}
! [Test]
! public void ArgTypes()
{
! MockCall call = new MockCall(null, null, new object[] {1, "string",
! new bool[] {true, false}});
Assertion.AssertEquals("Parameter one", typeof(int), call.ArgTypes[0]);
Assertion.AssertEquals("Parameter two", typeof(string), call.ArgTypes[1]);
Assertion.AssertEquals("Parameter three", typeof(bool[]), call.ArgTypes[2]);
}
-
}
}
--- 408,426 ----
}
}
+
+ }
! [TestFixture] public class MockCallTest
! {
! [Test] public void ArgTypes()
{
! MockCall call = new MockCall(
! new MethodSignature("mymock", "call", new Type[] {typeof(int), typeof(string), typeof(bool[]) }),
! null, null,
! new object[] {1, "string", new bool[] {true, false}});
Assertion.AssertEquals("Parameter one", typeof(int), call.ArgTypes[0]);
Assertion.AssertEquals("Parameter two", typeof(string), call.ArgTypes[1]);
Assertion.AssertEquals("Parameter three", typeof(bool[]), call.ArgTypes[2]);
}
}
}
|
|
From: <sm...@us...> - 2003-08-08 00:05:06
|
Update of /cvsroot/nmock/nmock
In directory sc8-pr-cvs1:/tmp/cvs-serv5316
Modified Files:
nmock.sln
Log Message:
Added Invocation and MethodSignature to collect data values together.
Include type name in error reports
Tidied up MockTest.
Index: nmock.sln
===================================================================
RCS file: /cvsroot/nmock/nmock/nmock.sln,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** nmock.sln 24 Jul 2003 23:09:23 -0000 1.3
--- nmock.sln 8 Aug 2003 00:05:03 -0000 1.4
***************
*** 1,33 ****
Microsoft Visual Studio Solution File, Format Version 8.00
! Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "src", "src\src.csproj", "{4859B9E5-3F65-4517-878C-AFC58B9D0035}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
! Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "test", "test\test.csproj", "{2735C01B-475D-4B75-AF30-C00D9A977E58}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
! Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "sample", "sample\sample.csproj", "{77AB0622-D9F4-4D60-9A13-73703FE41788}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Global
- GlobalSection(SourceCodeControl) = preSolution
- SccNumberOfProjects = 4
- SccProjectName0 = Perforce\u0020Project
- SccLocalPath0 = .
- SccProvider0 = MSSCCI:Perforce\u0020SCM
- CanCheckoutShared = true
- SolutionUniqueID = {D1A7C12C-013C-4686-A687-CEC9585CDE0D}
- SccProjectUniqueName1 = src\\src.csproj
- SccLocalPath1 = src
- CanCheckoutShared = true
- SccProjectUniqueName2 = test\\test.csproj
- SccLocalPath2 = test
- CanCheckoutShared = true
- SccProjectUniqueName3 = sample\\sample.csproj
- SccLocalPath3 = sample
- CanCheckoutShared = true
- EndGlobalSection
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
--- 1,16 ----
Microsoft Visual Studio Solution File, Format Version 8.00
! Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "test", "test\test.csproj", "{2735C01B-475D-4B75-AF30-C00D9A977E58}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
! Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "sample", "sample\sample.csproj", "{77AB0622-D9F4-4D60-9A13-73703FE41788}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
! Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "src", "src\src.csproj", "{4859B9E5-3F65-4517-878C-AFC58B9D0035}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
***************
*** 35,42 ****
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
- {4859B9E5-3F65-4517-878C-AFC58B9D0035}.Debug.ActiveCfg = Debug|.NET
- {4859B9E5-3F65-4517-878C-AFC58B9D0035}.Debug.Build.0 = Debug|.NET
- {4859B9E5-3F65-4517-878C-AFC58B9D0035}.Release.ActiveCfg = Release|.NET
- {4859B9E5-3F65-4517-878C-AFC58B9D0035}.Release.Build.0 = Release|.NET
{2735C01B-475D-4B75-AF30-C00D9A977E58}.Debug.ActiveCfg = Debug|.NET
{2735C01B-475D-4B75-AF30-C00D9A977E58}.Debug.Build.0 = Debug|.NET
--- 18,21 ----
***************
*** 47,50 ****
--- 26,33 ----
{77AB0622-D9F4-4D60-9A13-73703FE41788}.Release.ActiveCfg = Release|.NET
{77AB0622-D9F4-4D60-9A13-73703FE41788}.Release.Build.0 = Release|.NET
+ {4859B9E5-3F65-4517-878C-AFC58B9D0035}.Debug.ActiveCfg = Debug|.NET
+ {4859B9E5-3F65-4517-878C-AFC58B9D0035}.Debug.Build.0 = Debug|.NET
+ {4859B9E5-3F65-4517-878C-AFC58B9D0035}.Release.ActiveCfg = Release|.NET
+ {4859B9E5-3F65-4517-878C-AFC58B9D0035}.Release.Build.0 = Release|.NET
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
|
|
From: <sm...@us...> - 2003-08-08 00:05:06
|
Update of /cvsroot/nmock/nmock/src
In directory sc8-pr-cvs1:/tmp/cvs-serv5316/src
Modified Files:
src.csproj
Log Message:
Added Invocation and MethodSignature to collect data values together.
Include type name in error reports
Tidied up MockTest.
Index: src.csproj
===================================================================
RCS file: /cvsroot/nmock/nmock/src/src.csproj,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** src.csproj 25 Jul 2003 17:14:53 -0000 1.5
--- src.csproj 8 Aug 2003 00:05:03 -0000 1.6
***************
*** 110,113 ****
--- 110,118 ----
/>
<File
+ RelPath = "NMock\Invocation.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
RelPath = "NMock\IVerifiable.cs"
SubType = "Code"
***************
*** 116,119 ****
--- 121,129 ----
<File
RelPath = "NMock\Method.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "NMock\MethodSignature.cs"
SubType = "Code"
BuildAction = "Compile"
|
|
From: Vaughn, C. <Va...@va...> - 2003-08-07 20:22:51
|
Hello all,
I hate to pester, but does anyone have a fix or workaround for DynamicMocks
returning ValueTypes like Dates and Colors. I'm currently having to code
interfaces like:
interface IFoo
{
string BackColor { get; set; }
}
and parsing strings instead of
interface IFoo
{
System.Drawing.Color BackColor { get; set; }
}
Your help will be greatly appreciated.
Clifton F. Vaughn
Senior Business Analyst
Information Technology
Valassis / IT Division
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: Mike R. <mi...@th...> - 2003-08-04 21:48:08
|
Owen Rogers wrote: >this is caused by the mock server used by the nmock remoting unit tests >sharing the same port as the CruiseControl.NET server (port 1234). doh! >what are the odds of picking the same (semi)random port? ok, ok steve, i'm >eating crow ;) >so, i can check in a fix that changes the port number, but it sounds like >for you, mike, that won't be the easiest solution. what about changing the >ccnet server port instead if that would be easier? > > I have changed CCNetLive to use different Remoting ports Mike |
|
From: Vaughn, C. <Va...@va...> - 2003-08-04 17:22:13
|
Is there a reason why ExpectAndReturn() isn't overloaded like SetupResult() to at least check the return type for DynamicMock? Clifton F. Vaughn Senior Business Analyst Information Technology Valassis / IT Division 19975 Victor Parkway Livonia, MI 48152 Tel 734.591.3000 Ext. 16726 Fax 734.632.6151 va...@va... www.valassis.com 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-04 17:18:44
|
I've made changes to FastErrorHandlingTests...
[Test]
public void ExpectWithMissingMethod()
{
try
{
empty.Expect("Foo");
Fail();
}
catch (MissingMethodException e)
{
AssertEquals("method <MockEmpty.Foo> not
defined", e.Message);
}
}
[Test]
[ExpectedException(typeof(MissingMethodException))]
public void ExpectAndReturnWithMissingMethod()
{
full.ExpectAndReturn("xxx", null);
}
[Test]
public void SetupResultWithWrongType()
{
try
{
full.SetupResult("Foo", true);
Fail();
}
catch (ArgumentException e)
{
AssertEquals("method <MockFull.Foo> returns
a System.String", e.Message);
}
}
[Test]
public void FailWhenMockedMethodNotVirtual()
{
try
{
full.Expect("Bar", "test");
Fail();
}
catch(ArgumentException e)
{
AssertEquals("method <MockFull.Bar> is not
virtual", e.Message);
}
}
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-08-04 17:02:17
|
Since I use a lot of mocks, sometimes it's tricky to figure out which one
gave an error. I'd like to have the mock name added to the error message
before the method name. Here's my version of MockTest with changes to the
test for e.Reason:
[Test]
public void ExpectedNoCallsMessage()
{
try
{
mock.ExpectNoCall("x");
mock.Call("x");
Assertion.Fail("Expected VerifyException");
}
catch (VerifyException e)
{
Assertion.AssertEquals("mymock.x() called",
e.Reason);
Assertion.AssertEquals(0, e.Expected);
Assertion.AssertEquals(1, e.Actual);
}
}
[Test]
public void ExpectedOneCallMessage()
{
try
{
mock.Expect("x");
mock.Verify();
Assertion.Fail("Expected VerifyException");
}
catch (VerifyException e)
{
Assertion.AssertEquals("mymock.x() never
called", e.Reason);
Assertion.AssertEquals(1, e.Expected);
Assertion.AssertEquals(0, e.Actual);
}
}
[Test]
public void ExpectedOneCallGotTooManyMessage()
{
try
{
mock.Expect("x");
mock.Call("x");
mock.Call("x");
mock.Verify();
Assertion.Fail("Expected VerifyException");
}
catch (VerifyException e)
{
Assertion.AssertEquals("mymock.x() called
too many times", e.Reason);
Assertion.AssertEquals(1, e.Expected);
Assertion.AssertEquals(2, e.Actual);
}
}
[Test]
public void ExpectedManyCallsGotNoneMessage()
{
try
{
mock.Expect("x");
mock.Expect("x");
mock.Verify();
Assertion.Fail("Expected VerifyException");
}
catch (VerifyException e)
{
Assertion.AssertEquals("mymock.x() never
called", e.Reason);
Assertion.AssertEquals(2, e.Expected);
Assertion.AssertEquals(0, e.Actual);
}
}
[Test]
public void ExpectedManyCallsGotOneMessage()
{
try
{
mock.Expect("x");
mock.Expect("x");
mock.Call("x");
mock.Verify();
Assertion.Fail("Expected VerifyException");
}
catch (VerifyException e)
{
Assertion.AssertEquals("mymock.x() not
called enough times", e.Reason);
Assertion.AssertEquals(2, e.Expected);
Assertion.AssertEquals(1, e.Actual);
}
}
[Test]
public void ExpectedManyCallsGotTooManyMessage()
{
try
{
mock.Expect("x");
mock.Expect("x");
mock.Call("x");
mock.Call("x");
mock.Call("x");
mock.Verify();
Assertion.Fail("Expected VerifyException");
}
catch (VerifyException e)
{
Assertion.AssertEquals("mymock.x() called
too many times", e.Reason);
Assertion.AssertEquals(2, e.Expected);
Assertion.AssertEquals(3, e.Actual);
}
}
[Test]
public void ExpectedManyCallsGotNotEnoughMessage()
{
try
{
mock.Expect("x");
mock.Expect("x");
mock.Expect("x");
mock.Call("x");
mock.Call("x");
mock.Verify();
Assertion.Fail("Expected VerifyException");
}
catch (VerifyException e)
{
Assertion.AssertEquals(3, e.Expected);
Assertion.AssertEquals(2, e.Actual);
Assertion.AssertEquals("mymock.x() not
called enough times", e.Reason);
}
}
[Test]
public void IncorrectNumberOfParametersMessage()
{
try
{
mock.Expect("x", new object[] {1, 2, 3} );
mock.Call("x", new object[] {2, 3});
Assertion.Fail("Expected VerifyException");
}
catch (VerifyException e)
{
Assertion.AssertEquals("mymock.x() called
with incorrect number of parameters", e.Reason);
Assertion.AssertEquals(3, e.Expected);
Assertion.AssertEquals(2, e.Actual);
}
}
[Test]
public void IncorrectParameterConstraintMessage()
{
try
{
IMock Constraint = new
DynamicMock(typeof(IConstraint));
Constraint.SetupResult("Message", "wee
woo");
Constraint.SetupResult("Eval", false,
typeof(object));
mock.Expect("x", new IsAnything(),
(IConstraint)Constraint.MockInstance);
mock.Call("x", "hello", "world");
Assertion.Fail("Expected VerifyException");
}
catch (VerifyException e)
{
Assertion.AssertEquals("mymock.x() called
with incorrect parameter (2)", e.Reason);
Assertion.AssertEquals("wee woo",
e.Expected);
Assertion.AssertEquals("world", e.Actual);
}
}
I've made changes to my copy and it mainly involves just adding another parm
to MockCall and its derivatives.
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: <st...@m3...> - 2003-08-04 15:13:33
|
On 4 August, 2003, Vaughn, Clifton wrote: > I've seen the test for SetupResult. You should probably change it to use > Expect() instead of ExpectAndReturn(). I don't think I'd expect > SetupResult() and ExpectAndReturn() to work together. As a side note, any OK. > idea on getting the ValueType return values to work? If I get time, I've got a snapshot of the whole tree. Otherwise, it would b= e nice if the relevant people would commit the d**mned patch themeselves ;-) S. |
|
From: Vaughn, C. <Va...@va...> - 2003-08-04 13:43:17
|
Steve, I've seen the test for SetupResult. You should probably change it to use Expect() instead of ExpectAndReturn(). I don't think I'd expect SetupResult() and ExpectAndReturn() to work together. As a side note, any idea on getting the ValueType return values to work? cliff -----Original Message----- From: Steve Freeman [mailto:st...@m3...] Sent: Sunday, August 03, 2003 7:03 PM To: Vaughn, Clifton Cc: Nmock-General (E-mail) Subject: Re: [Nmock-general] problem with SetupResult I've checked in a failing test for this. S. |
|
From: Steve F. <st...@m3...> - 2003-08-03 23:03:45
|
I've checked in a failing test for this. S. |
|
From: Steve F. <st...@m3...> - 2003-08-03 23:02:05
|
I've checked in a failing test for this. S. |
|
From: <sm...@us...> - 2003-08-03 23:01:24
|
Update of /cvsroot/nmock/nmock/test/NMock
In directory sc8-pr-cvs1:/tmp/cvs-serv2325/test/NMock
Modified Files:
DynamicMockTest.cs
Log Message:
Added failing test to mark problem with SetupResult
Reported by Clifton Vaughn
Index: DynamicMockTest.cs
===================================================================
RCS file: /cvsroot/nmock/nmock/test/NMock/DynamicMockTest.cs,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** DynamicMockTest.cs 3 Aug 2003 22:42:47 -0000 1.12
--- DynamicMockTest.cs 3 Aug 2003 23:01:22 -0000 1.13
***************
*** 66,69 ****
--- 66,73 ----
}
}
+ interface IWithProperty
+ {
+ string Name { get; set; }
+ }
#endregion
***************
*** 228,231 ****
--- 232,264 ----
IMock mock = new DynamicMock(typeof(WithNonEmptyConstructor));
WithNonEmptyConstructor nonEmpty = (WithNonEmptyConstructor)mock.MockInstance;
+ }
+
+ [Test] public void CanSetAndGetPropertiesOnAMockedInterface()
+ {
+ DynamicMock mock = new DynamicMock(typeof(IWithProperty));
+ IWithProperty withProperty = (IWithProperty)mock.MockInstance;
+
+ mock.ExpectAndReturn("Name", "fred");
+ mock.Expect("Name", "joe");
+
+ AssertEquals("Should be property Name", "fred", withProperty.Name);
+ withProperty.Name = "joe";
+
+ mock.Verify();
+ }
+
+
+ [Test] [Ignore("SetupResult doesn't work for properties")] public void SetAndGetPropertiesDoesNotWorkWithSetupReturn()
+ {
+ DynamicMock mock = new DynamicMock(typeof(IWithProperty));
+ IWithProperty withProperty = (IWithProperty)mock.MockInstance;
+
+ mock.SetupResult("Name", "fred");
+ mock.ExpectAndReturn("Name", "jim");
+
+ AssertEquals("Should be property Name", "fred", withProperty.Name);
+ withProperty.Name = "jim";
+
+ mock.Verify();
}
}
|
|
From: Steve F. <st...@m3...> - 2003-08-03 22:43:39
|
Fix checked in. Dodgy field initialisation...
S.
Vaughn, Clifton wrote:
> 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.
>
>
>
> -------------------------------------------------------
> 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: <sm...@us...> - 2003-08-03 22:42:50
|
Update of /cvsroot/nmock/nmock/test/NMock
In directory sc8-pr-cvs1:/tmp/cvs-serv32198/test/NMock
Modified Files:
DynamicMockTest.cs
Log Message:
Fixed bug related to incorrect initialisation of DynamicMock
Reported by Clifton Vaughn
Index: DynamicMockTest.cs
===================================================================
RCS file: /cvsroot/nmock/nmock/test/NMock/DynamicMockTest.cs,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** DynamicMockTest.cs 30 Jul 2003 17:28:42 -0000 1.11
--- DynamicMockTest.cs 3 Aug 2003 22:42:47 -0000 1.12
***************
*** 92,95 ****
--- 92,107 ----
}
+ [Test] public void NamedDynamicMockImplementsAnInterface()
+ {
+ IMock mock = new DynamicMock(typeof(IBlah), "XBlah");
+
+ mock.ExpectAndReturn("DoStuff", "world", "hello");
+
+ IBlah blah = (IBlah)mock.MockInstance;
+ Assertion.AssertEquals("world", blah.DoStuff("hello"));
+
+ mock.Verify();
+ }
+
[Test] public void CanBeCustomisedByOverridingCallMethod()
{
|
|
From: <sm...@us...> - 2003-08-03 22:42:50
|
Update of /cvsroot/nmock/nmock/src/NMock
In directory sc8-pr-cvs1:/tmp/cvs-serv32198/src/NMock
Modified Files:
DynamicMock.cs
Log Message:
Fixed bug related to incorrect initialisation of DynamicMock
Reported by Clifton Vaughn
Index: DynamicMock.cs
===================================================================
RCS file: /cvsroot/nmock/nmock/src/NMock/DynamicMock.cs,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** DynamicMock.cs 25 Jul 2003 15:52:11 -0000 1.12
--- DynamicMock.cs 3 Aug 2003 22:42:47 -0000 1.13
***************
*** 12,25 ****
private object obj;
private Type type;
! private IList ignore;
! public DynamicMock(Type type) : this(type, null)
! {
! ignore = new ArrayList();
! Name = "Mock" + type.Name;
! }
public DynamicMock(Type type, string name) : base(name)
{
this.type = type;
}
--- 12,22 ----
private object obj;
private Type type;
! private IList ignoredMethodNames;
! public DynamicMock(Type type) : this(type, "Mock" + type.Name) {}
public DynamicMock(Type type, string name) : base(name)
{
+ this.ignoredMethodNames = new ArrayList();
this.type = type;
}
***************
*** 42,46 ****
public virtual void Ignore(string methodName)
{
! ignore.Add(methodName);
}
--- 39,43 ----
public virtual void Ignore(string methodName)
{
! ignoredMethodNames.Add(methodName);
}
***************
*** 48,52 ****
{
ClassGenerator cg = createClassGenerator();
! obj = cg.Generate(type, this, ignore);
}
--- 45,49 ----
{
ClassGenerator cg = createClassGenerator();
! obj = cg.Generate(type, this, ignoredMethodNames);
}
|
|
From: Owen R. <OR...@th...> - 2003-08-03 18:30:54
|
this is caused by the mock server used by the nmock remoting unit tests sharing the same port as the CruiseControl.NET server (port 1234). doh! what are the odds of picking the same (semi)random port? ok, ok steve, i'm eating crow ;) so, i can check in a fix that changes the port number, but it sounds like for you, mike, that won't be the easiest solution. what about changing the ccnet server port instead if that would be easier? sorry all. o. --- R. Owen Rogers ThoughtWorks Ltd ThoughtWorks - Deliver with passion! |---------+-----------------------------------------> | | Joe Walnes <jo...@tr...> | | | Sent by: | | | nmo...@li...| | | ceforge.net | | | | | | | | | 07/30/2003 07:18 PM | |---------+-----------------------------------------> >--------------------------------------------------------------------------------------------------------------------------------------------------| | | | To: Mike Roberts <mi...@th...> | | cc: nmo...@li..., exo...@us..., joe...@us..., ma...@us...,| | sk...@us..., sm...@us... | | Subject: [Nmock-general] Re: CruiseControl.NET instance now running for NMock (and a problem with a test) | >--------------------------------------------------------------------------------------------------------------------------------------------------| 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 > > > > > ------------------------------------------------------- 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 |