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: Nick R. <nic...@fr...> - 2004-04-26 14:24:18
|
I have a colleague who has tried to Mock a DateTime field on an interface:
IFoo
{
DateTime Date
{
get;
set;
}
}
When a mock of IFoo is passed into a client call, access of non-DateTime properties work, but an access to the Date property generates an error about
the object reference being null. Is there a known issue with Dates?
Nick.
|
|
From: Chris T. <cti...@av...> - 2004-04-21 02:12:08
|
I have defined the following interface:=20
public interface IWithOverloadedIndexer=20
{=20
string this[int index]{get;}=20
string this[Guid ID]{get;}=20
}=20
And the following test (I've tried with SetupResult and
ExpectAndReturn):=20
[Test] public void VerifyThatSetupOfMultipleIndexersFail()=20
{=20
DynamicMock mock =3D new DynamicMock(typeof(IWithOverloadedIndexer));=20
mock.SetupResult("Item","I will Fail",typeof(int));=20
}=20
When I run the test, I get the following error:=20
TestCase 'NMock.DynamicMockTest.VerifyThatSetupOfMultipleIndexersFail'
failed: System.Reflection.AmbiguousMatchException : Ambiguous match
found.=20
at System.RuntimeType.GetPropertyImpl(String name, BindingFlags
bindingAttr, Binder binder, Type returnType, Type[] types,
ParameterModifier[] modifiers)=20
at System.Type.GetProperty(String name, BindingFlags bindingAttr)=20
C:\Utilities\nMock\nmock\src\NMock\MethodSignature.cs(50,0): at
NMock.MethodSignature.FindMatchingPropertyOn(Type type)=20
C:\Utilities\nMock\nmock\src\NMock\DynamicMock.cs(98,0): at
NMock.DynamicMock.GetReturnTypeForSignature(MethodSignature signature)=20
C:\Utilities\nMock\nmock\src\NMock\DynamicMock.cs(73,0): at
NMock.DynamicMock.CheckReturnTypeIsValid(MethodSignature signature,
Object returnVal)=20
C:\Utilities\nMock\nmock\src\NMock\DynamicMock.cs(61,0): at
NMock.DynamicMock.SetupResult(String methodName, Object returnVal,
Type[] argTypes)=20
c:\utilities\nmock\nmock\test\nmock\dynamicmocktest.cs(390,0): at
NMock.DynamicMockTest.VerifyThatSetupOfMultipleIndexersFail()=20
I have stepped through the code and it looks as if though we are always
assuming that Properties will have no parameters.=20
|
|
From: Owen R. <exo...@us...> - 2004-04-08 04:00:48
|
Update of /cvsroot/nmock/nmock/test/NMock In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8638/test/NMock Modified Files: DynamicMockTest.cs FastErrorHandlingTest.cs Log Message: - applying Levi's fixes - fixed bug where NMock overrides the class' destructor Index: FastErrorHandlingTest.cs =================================================================== RCS file: /cvsroot/nmock/nmock/test/NMock/FastErrorHandlingTest.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FastErrorHandlingTest.cs 29 Nov 2003 17:04:47 -0000 1.4 --- FastErrorHandlingTest.cs 8 Apr 2004 03:47:41 -0000 1.5 *************** *** 25,28 **** --- 25,33 ---- } + public virtual string Foo(string s) + { + return "foo"; + } + public string Bar(string s) { *************** *** 51,57 **** catch (MissingMethodException e) { ! AssertEquals("method <Foo> not defined", e.Message); } } [Test] --- 56,96 ---- catch (MissingMethodException e) { ! AssertEquals( ! "method <MockEmpty.Foo()> not defined", e.Message); } } + + [Test] + public void ExpectWithWrongArgType() + { + try + { + full.Expect("Foo", 1); + Fail(); + } + catch (MissingMethodException e) + { + AssertEquals( + "method <MockFull.Foo(System.Int32)> not defined", + e.Message); + } + } + + [Test] + public void ExpectWithWrongArgNumber() + { + try + { + full.Expect("Foo", true, 1); + Fail(); + } + catch (MissingMethodException e) + { + AssertEquals( + "method <MockFull.Foo(System.Boolean, System.Int32)> not defined", + e.Message); + } + } + [Test] *************** *** 72,76 **** catch (ArgumentException e) { ! AssertEquals("method <Foo> should return a System.String", e.Message); } } --- 111,117 ---- catch (ArgumentException e) { ! AssertEquals( ! "method <MockFull.Foo()> should return a System.String", ! e.Message); } } Index: DynamicMockTest.cs =================================================================== RCS file: /cvsroot/nmock/nmock/test/NMock/DynamicMockTest.cs,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** DynamicMockTest.cs 23 Mar 2004 06:20:17 -0000 1.19 --- DynamicMockTest.cs 8 Apr 2004 03:47:41 -0000 1.20 *************** *** 83,86 **** --- 83,92 ---- Mock ReturnIt(); } + + public class DisposableThingy : Thingy + { + public static int DestructorCallCount = 0; + ~DisposableThingy() { DestructorCallCount++; } + } #endregion *************** *** 364,367 **** --- 370,389 ---- mock.Verify(); } + + [Test] public void VerifyThatFinalizeIsNotOverriddenInMockSubClass() + { + DisposableThingy.DestructorCallCount = 0; + CreateDisposableThingyMock(); + GC.Collect(); + AssertEquals(1, DisposableThingy.DestructorCallCount); + DisposableThingy.DestructorCallCount = 0; + } + + private void CreateDisposableThingyMock() + { + IMock mock = new DynamicMock(typeof(DisposableThingy)); + mock.Strict = true; + DisposableThingy thingy = (DisposableThingy) mock.MockInstance; + } } } |
|
From: Owen R. <exo...@us...> - 2004-04-08 04:00:46
|
Update of /cvsroot/nmock/nmock/src/NMock In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8638/src/NMock Modified Files: DynamicMock.cs MethodSignature.cs Log Message: - applying Levi's fixes - fixed bug where NMock overrides the class' destructor Index: MethodSignature.cs =================================================================== RCS file: /cvsroot/nmock/nmock/src/NMock/MethodSignature.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MethodSignature.cs 28 Nov 2003 17:31:22 -0000 1.2 --- MethodSignature.cs 8 Apr 2004 03:47:39 -0000 1.3 *************** *** 1,4 **** --- 1,5 ---- using System; using System.Reflection; + using System.Text; using NMock.Constraints; *************** *** 22,26 **** public override string ToString() { ! return typeName + "." + methodName + "()"; } --- 23,34 ---- public override string ToString() { ! StringBuilder argumentList = new StringBuilder(); ! foreach (Type type in argumentTypes) ! { ! if (argumentList.Length > 0) argumentList.Append(", "); ! ! argumentList.Append(type.FullName); ! } ! return string.Format("{0}.{1}({2})", typeName, methodName, argumentList); } *************** *** 38,45 **** --- 46,72 ---- } + public PropertyInfo FindMatchingPropertyOn(Type type) + { + return type.GetProperty( + methodName, ClassGenerator.ALL_INSTANCE_METHODS); + } + + public MethodInfo FindMatchingMethodIn(Type type) + { + foreach (MethodInfo methodInfo in type.GetMethods(ClassGenerator.ALL_INSTANCE_METHODS)) + { + if (MatchesNameAndAllNonNullArguments(methodInfo)) + { + return methodInfo; + } + } + return null; + } + public bool IsPropertyOn(Type type) { return type.GetProperty(methodName, ClassGenerator.ALL_INSTANCE_METHODS) != null; } + public bool HasMatchingMethodIn(Type type) { *************** *** 68,71 **** --- 95,99 ---- } + private bool MatchNonNullArguments(ParameterInfo[] parameters) { *************** *** 76,84 **** { Type argumentType = argumentTypes[pi]; ! if ( argumentType != null && parameters[pi].GetType().IsAssignableFrom(argumentType) ) ! return false; } return true; - } } } --- 104,116 ---- { Type argumentType = argumentTypes[pi]; ! if (argumentType == null) ! continue; ! ! Type parameterType = parameters[pi].ParameterType; ! if (!parameterType.IsAssignableFrom(argumentType)) ! return false; } return true; } } + } Index: DynamicMock.cs =================================================================== RCS file: /cvsroot/nmock/nmock/src/NMock/DynamicMock.cs,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** DynamicMock.cs 23 Mar 2004 06:20:17 -0000 1.20 --- DynamicMock.cs 8 Apr 2004 03:47:38 -0000 1.21 *************** *** 59,76 **** { MethodSignature signature = new MethodSignature(Name, methodName, argTypes); ! CheckMethodIsValidIfNoConstraints(signature); ! CheckReturnTypeIsValid(methodName, returnVal); SetupResult(signature, returnVal); } ! void CheckReturnTypeIsValid(string methodName, object returnVal) { if (returnVal == null) return; ! Type realReturnType = ReturnTypeForMethodName(methodName); if(! realReturnType.IsAssignableFrom(returnVal.GetType())) { ! throw new ArgumentException(String.Format("method <{0}> should return a {1}", methodName, realReturnType)); } } --- 59,80 ---- { MethodSignature signature = new MethodSignature(Name, methodName, argTypes); ! CheckReturnTypeIsValid(signature, returnVal); SetupResult(signature, returnVal); } ! private void CheckReturnTypeIsValid(MethodSignature signature, object returnVal) { if (returnVal == null) return; ! if (signature.HasAConstraintArgument) ! return; ! ! Type realReturnType = GetReturnTypeForSignature(signature); if(! realReturnType.IsAssignableFrom(returnVal.GetType())) { ! throw new ArgumentException( ! string.Format("method <{0}> should return a {1}", ! signature, realReturnType)); } } *************** *** 81,107 **** return; ! foreach (Type t in new InterfaceLister().List(type)) ! { ! if (signature.IsPropertyOn(t) || signature.HasMatchingMethodIn(t)) ! return; ! } ! ! throw new MissingMethodException(String.Format("method <{0}> not defined", signature.methodName)); } ! private Type ReturnTypeForMethodName(string methodName) { foreach (Type t in new InterfaceLister().List(type)) { ! MethodInfo method = t.GetMethod(methodName, ClassGenerator.ALL_INSTANCE_METHODS); if (method != null) return method.ReturnType; ! PropertyInfo property = t.GetProperty(methodName, ClassGenerator.ALL_INSTANCE_METHODS); if (property != null) return property.PropertyType; } ! throw new MissingMethodException(String.Format("method <{0}> not defined", methodName)); } } --- 85,106 ---- return; ! GetReturnTypeForSignature(signature); } ! private Type GetReturnTypeForSignature(MethodSignature signature) { foreach (Type t in new InterfaceLister().List(type)) { ! MethodInfo method = signature.FindMatchingMethodIn(t); if (method != null) return method.ReturnType; ! PropertyInfo property = signature.FindMatchingPropertyOn(t); if (property != null) return property.PropertyType; } ! throw new MissingMethodException( ! string.Format("method <{0}> not defined", signature)); } } |
|
From: Owen R. <exo...@us...> - 2004-04-08 04:00:45
|
Update of /cvsroot/nmock/nmock/src/NMock/Dynamic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8638/src/NMock/Dynamic Modified Files: ClassGenerator.cs Log Message: - applying Levi's fixes - fixed bug where NMock overrides the class' destructor Index: ClassGenerator.cs =================================================================== RCS file: /cvsroot/nmock/nmock/src/NMock/Dynamic/ClassGenerator.cs,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** ClassGenerator.cs 21 Aug 2003 00:26:16 -0000 1.19 --- ClassGenerator.cs 8 Apr 2004 03:47:40 -0000 1.20 *************** *** 33,41 **** } - public virtual object Generate() { methodsToIgnore.Add("Equals"); methodsToIgnore.Add("ToString"); TypeBuilder typeBuilder = CreateTypeBuilder(); --- 33,41 ---- } public virtual object Generate() { methodsToIgnore.Add("Equals"); methodsToIgnore.Add("ToString"); + methodsToIgnore.Add("Finalize"); TypeBuilder typeBuilder = CreateTypeBuilder(); |
|
From: Owen R. <OR...@th...> - 2004-04-06 17:29:06
|
i discovered a fun little bug in nmock yesterday. i noticed that i was receiving a strange verify exception that was occurring outside of my tests. the exception reported that the Finalize() method was getting called too many times. incidentally, Finalize() is the class destructor -- it is what the ~Class() method gets turned into by the C# compiler. Finalize() is a virtual method, so it was getting overriden by the mock proxy. when the garbage collector went to dispose of the proxy, a verify exception was thrown because i hadn't set up an expectation for my destructor :). note: this is only a problem if you are generating a mock from a concrete class and setting the mock to strict. to fix the problem, i have ammended the mock class so that it doesn't override the destructor -- i can't imagine why you would want to mock your class' destructor as it is typically something that you don't call directly. it also feels a little bit disconcerting to override the destructor for a base class which might actually be doing something important. commits forthcoming. cheers, owen. --- R. Owen Rogers ThoughtWorks Technologies (India) Pvt Ltd. ThoughtWorks - Deliver with passion! ThoughtWorks is always looking for talented people who are passionate about technology. To find out more about a career at ThoughtWorks go to http://www.thoughtworks.com/career/. |
|
From: Chris s. <sk...@us...> - 2004-03-30 10:45:55
|
Update of /cvsroot/nmock/nmock/sample/tutorial In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29889/sample/tutorial Added Files: ISendMail.cs Log Message: adding tutorial file for testing of snippet plugin --- NEW FILE: ISendMail.cs --- |
|
From: Chris s. <sk...@us...> - 2004-03-30 10:44:13
|
Update of /cvsroot/nmock/nmock/sample/tutorial In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29473/tutorial Log Message: Directory /cvsroot/nmock/nmock/sample/tutorial added to the repository |
|
From: Owen R. <OR...@th...> - 2004-03-25 14:01:26
|
nmock is back up and working again on ccnetlive: http://ccnetlive.thoughtworks.com/nmock/. what this means is that CruiseControl.NET is generating new builds of NMock every time we check in changes. the latest versions of nmock.dll produced as a product of these builds are published to be downloaded from here: http://ccnetlive.thoughtworks.com/NMock-builds/. cheers, owen. --- R. Owen Rogers ThoughtWorks Technologies (India) Pvt Ltd. ThoughtWorks - Deliver with passion! ThoughtWorks is always looking for talented people who are passionate about technology. To find out more about a career at ThoughtWorks go to http://www.thoughtworks.com/career/. |
|
From: Owen R. <exo...@us...> - 2004-03-25 13:47:04
|
Update of /cvsroot/nmock/nmock/test/NMock In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1305/test/NMock Modified Files: MockContainerTest.cs Log Message: fixed bug in MockContainer due to hashtable ordering Index: MockContainerTest.cs =================================================================== RCS file: /cvsroot/nmock/nmock/test/NMock/MockContainerTest.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MockContainerTest.cs 23 Mar 2004 06:20:17 -0000 1.1 --- MockContainerTest.cs 25 Mar 2004 13:36:16 -0000 1.2 *************** *** 66,70 **** IMock m = container[typeof(Foo)]; } ! public class Foo { --- 66,70 ---- IMock m = container[typeof(Foo)]; } ! } public class Foo { *************** *** 108,111 **** string There { get; } } - } } --- 108,110 ---- |
|
From: Owen R. <exo...@us...> - 2004-03-25 13:47:03
|
Update of /cvsroot/nmock/nmock/src/NMock In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1305/src/NMock Modified Files: MockContainer.cs Log Message: fixed bug in MockContainer due to hashtable ordering Index: MockContainer.cs =================================================================== RCS file: /cvsroot/nmock/nmock/src/NMock/MockContainer.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MockContainer.cs 23 Mar 2004 06:20:17 -0000 1.1 --- MockContainer.cs 25 Mar 2004 13:36:15 -0000 1.2 *************** *** 8,12 **** { private Type type; ! private Hashtable mocks = new Hashtable(); private object instance; --- 8,13 ---- { private Type type; ! private ConstructorInfo constructor; ! private IDictionary mocks; private object instance; *************** *** 14,19 **** { this.type = type; ! ConstructorInfo info = GetConstructorToUse(type); ! CreateMocks(info); } --- 15,20 ---- { this.type = type; ! constructor = GetConstructorToUse(type); ! mocks = CreateMocks(); } *************** *** 32,41 **** } ! private void CreateMocks(ConstructorInfo info) { ! foreach (ParameterInfo parameterInfo in info.GetParameters()) { ! mocks[parameterInfo.ParameterType] = new DynamicMock(parameterInfo.ParameterType); } } --- 33,44 ---- } ! private IDictionary CreateMocks() { ! Hashtable result = new Hashtable(); ! foreach (ParameterInfo parameterInfo in constructor.GetParameters()) { ! result[parameterInfo.ParameterType] = new DynamicMock(parameterInfo.ParameterType); } + return result; } *************** *** 67,77 **** private object[] CreateMockInstances() { ! object[] result = new object[mocks.Count]; ! int i = 0; ! foreach (IMock mock in mocks.Values) { ! result[i++] = mock.MockInstance; } ! return result; } --- 70,81 ---- private object[] CreateMockInstances() { ! ParameterInfo[] parameters = constructor.GetParameters(); ! ArrayList result = new ArrayList(); ! foreach (ParameterInfo parameter in parameters) { ! IMock mock = (IMock) mocks[parameter.ParameterType]; ! result.Add(mock.MockInstance); } ! return result.ToArray(); } |
|
From: Owen R. <exo...@us...> - 2004-03-25 13:47:03
|
Update of /cvsroot/nmock/nmock In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1305 Modified Files: nmock.build Log Message: fixed bug in MockContainer due to hashtable ordering Index: nmock.build =================================================================== RCS file: /cvsroot/nmock/nmock/nmock.build,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** nmock.build 25 Mar 2004 11:51:07 -0000 1.7 --- nmock.build 25 Mar 2004 13:36:15 -0000 1.8 *************** *** 38,43 **** <target name="test" depends="compile" description="Run unit tests"> <nunit2> ! <formatter type="Plain" /> ! <test assemblyname="build\nmock.test.dll" fork="true" type="${nunit.output}"/> </nunit2> </target> --- 38,43 ---- <target name="test" depends="compile" description="Run unit tests"> <nunit2> ! <formatter type="${nunit.output}" /> ! <test assemblyname="build\nmock.test.dll" /> </nunit2> </target> |
|
From: Owen R. <exo...@us...> - 2004-03-25 12:24:26
|
Update of /cvsroot/nmock/nmock/test/NMock/Remoting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17490/test/NMock/Remoting Modified Files: MockServerTest.cs Log Message: changed port for MockServerTest so it doesn't conflict with ccnetlive Index: MockServerTest.cs =================================================================== RCS file: /cvsroot/nmock/nmock/test/NMock/Remoting/MockServerTest.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MockServerTest.cs 13 Jul 2003 13:27:07 -0000 1.1 --- MockServerTest.cs 25 Mar 2004 12:13:33 -0000 1.2 *************** *** 15,22 **** mock.Expect("Bar"); ! TcpChannel channel = new TcpChannel(1234); using (MockServer server = new MockServer(mock.MarshalByRefInstance, channel, "mock.rem")) { ! Foo foo = (Foo)RemotingServices.Connect(typeof(Foo), "tcp://localhost:1234/mock.rem"); foo.Bar(); } --- 15,22 ---- mock.Expect("Bar"); ! TcpChannel channel = new TcpChannel(1255); using (MockServer server = new MockServer(mock.MarshalByRefInstance, channel, "mock.rem")) { ! Foo foo = (Foo)RemotingServices.Connect(typeof(Foo), "tcp://localhost:1255/mock.rem"); foo.Bar(); } |
|
From: Owen R. <exo...@us...> - 2004-03-25 12:01:54
|
Update of /cvsroot/nmock/nmock In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13622 Modified Files: nmock.build Log Message: added section to publish nmock build on ccnetlive Index: nmock.build =================================================================== RCS file: /cvsroot/nmock/nmock/nmock.build,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** nmock.build 19 Feb 2004 05:21:36 -0000 1.6 --- nmock.build 25 Mar 2004 11:51:07 -0000 1.7 *************** *** 67,70 **** --- 67,87 ---- <property name="nunit.output" value="Xml"/> <call target="release"/> + <call target="dist.publish"/> </target> + + <target name="dist.publish"> + <ifnot propertyexists="label-to-apply"> + <fail message="label-to-apply property not set, so can't create labelled distribution files" /> + </ifnot> + + <property name="publish.dir" value="D:\download-area\NMock-Builds\${label-to-apply}" /> + + <mkdir dir="${publish.dir}" /> + <copy todir="${publish.dir}"> + <fileset basedir="dist"> + <includes name="*"/> + </fileset> + </copy> + </target> + </project> \ No newline at end of file |
Update of /cvsroot/nmock/nmock/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11415/tools Modified Files: ICSharpCode.SharpCvsLib.dll NAnt.Core.dll NAnt.DotNetTasks.dll NAnt.NUnit.dll NAnt.NUnit1Tasks.dll NAnt.NUnit2Tasks.dll NAnt.SourceControlTasks.dll NAnt.VSNetTasks.dll NAnt.VisualCppTasks.dll NAnt.Win32Tasks.dll NAnt.ZipTasks.dll NAnt.exe.config NDoc.Core.dll NDoc.Documenter.Msdn.dll NDoc.Documenter.NAnt.dll nant.exe Removed Files: NAnt.Core.xml NAnt.DotNetTasks.xml NAnt.NUnit.xml NAnt.NUnit2Tasks.xml NAnt.xml log4net-net-1.0.dll Log Message: upgraded NAnt -- partially to work with ccnetlive Index: NAnt.NUnit1Tasks.dll =================================================================== RCS file: /cvsroot/nmock/nmock/tools/NAnt.NUnit1Tasks.dll,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvsYAoztg and /tmp/cvswJRcWw differ Index: NAnt.Core.dll =================================================================== RCS file: /cvsroot/nmock/nmock/tools/NAnt.Core.dll,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvsRr65zj and /tmp/cvsbfQB6z differ --- NAnt.NUnit.xml DELETED --- Index: NAnt.exe.config =================================================================== RCS file: /cvsroot/nmock/nmock/tools/NAnt.exe.config,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NAnt.exe.config 15 Jan 2004 00:59:39 -0000 1.2 --- NAnt.exe.config 25 Mar 2004 11:41:32 -0000 1.3 *************** *** 17,31 **** </appSettings> <!-- nant config settings --> ! <nant defaultframework="net-1.1" taskpath=".\optional"> <frameworks> ! <platform name="win32" default="net-1.0"> ! <framework name="net-1.0" description="Microsoft .NET Framework 1.0" version="${version}" runtimeengine="" ! sdkdirectory="${sdkInstallRoot}bin" frameworkdirectory="${installRoot}v${version}" frameworkassemblydirectory="${installRoot}v${version}"> <properties> ! <property name="version" value="1.0.3705" /> ! <property name="sdkInstallRoot" useregistry="true" regkey="SOFTWARE\Microsoft\.NETFramework" ! regvalue="sdkInstallRoot" /> ! <property name="installRoot" useregistry="true" regkey="SOFTWARE\Microsoft\.NETFramework" ! regvalue="InstallRoot" /> </properties> <tasks> --- 17,42 ---- </appSettings> <!-- nant config settings --> ! <nant> <frameworks> ! <platform name="win32" default="auto"> ! <framework ! name="net-1.0" ! family="net" ! version="1.0" ! description="Microsoft .NET Framework 1.0" ! runtimeengine="" ! sdkdirectory="${sdkInstallRoot}bin" ! frameworkdirectory="${installRoot}v${clrversion}" ! frameworkassemblydirectory="${installRoot}v${clrversion}" ! clrversion="${clrversion}" ! > ! <extensions> ! <includes name="*Tasks.dll" /> ! <includes name="*Tests.dll" /> ! </extensions> <properties> ! <property name="clrversion" value="1.0.3705" /> ! <property name="sdkInstallRoot" useregistry="true" regkey="SOFTWARE\Microsoft\.NETFramework" regvalue="sdkInstallRoot" /> ! <property name="installRoot" useregistry="true" regkey="SOFTWARE\Microsoft\.NETFramework" regvalue="InstallRoot" /> </properties> <tasks> *************** *** 54,67 **** <attribute name="useruntimeengine">false</attribute> </task> </tasks> </framework> ! <framework name="net-1.1" description="Microsoft .NET Framework 1.1" version="${version}" runtimeengine="" ! sdkdirectory="${sdkInstallRoot}bin" frameworkdirectory="${installRoot}v${version}" frameworkassemblydirectory="${installRoot}v${version}"> <properties> ! <property name="version" value="1.1.4322" /> ! <property name="sdkInstallRoot" useregistry="true" regkey="SOFTWARE\Microsoft\.NETFramework" ! regvalue="sdkInstallRootv1.1" /> ! <property name="installRoot" useregistry="true" regkey="SOFTWARE\Microsoft\.NETFramework" ! regvalue="InstallRoot" /> </properties> <tasks> --- 65,93 ---- <attribute name="useruntimeengine">false</attribute> </task> + <task name="delay-sign"> + <attribute name="exename">sn</attribute> + <attribute name="useruntimeengine">false</attribute> + </task> </tasks> </framework> ! <framework ! name="net-1.1" ! family="net" ! version="1.1" ! description="Microsoft .NET Framework 1.1" ! runtimeengine="" ! sdkdirectory="${sdkInstallRoot}bin" ! frameworkdirectory="${installRoot}v${clrversion}" ! frameworkassemblydirectory="${installRoot}v${clrversion}" ! clrversion="${clrversion}" ! > ! <extensions> ! <includes name="*Tasks.dll" /> ! <includes name="*Tests.dll" /> ! </extensions> <properties> ! <property name="clrversion" value="1.1.4322" /> ! <property name="sdkInstallRoot" useregistry="true" regkey="SOFTWARE\Microsoft\.NETFramework" regvalue="sdkInstallRootv1.1" /> ! <property name="installRoot" useregistry="true" regkey="SOFTWARE\Microsoft\.NETFramework" regvalue="InstallRoot" /> </properties> <tasks> *************** *** 90,103 **** <attribute name="useruntimeengine">false</attribute> </task> </tasks> </framework> ! <framework name="net-1.2" description="Microsoft .NET Framework 1.2" version="${version}" runtimeengine="" ! sdkdirectory="${sdkInstallRoot}bin" frameworkdirectory="${installRoot}v${version}" frameworkassemblydirectory="${installRoot}v${version}"> <properties> ! <property name="version" value="1.2.30703" /> ! <property name="sdkInstallRoot" useregistry="true" regkey="SOFTWARE\Microsoft\.NETFramework" ! regvalue="sdkInstallRootv1.2" /> ! <property name="installRoot" useregistry="true" regkey="SOFTWARE\Microsoft\.NETFramework" ! regvalue="InstallRoot" /> </properties> <tasks> --- 116,144 ---- <attribute name="useruntimeengine">false</attribute> </task> + <task name="delay-sign"> + <attribute name="exename">sn</attribute> + <attribute name="useruntimeengine">false</attribute> + </task> </tasks> </framework> ! <framework ! name="net-1.2" ! family="net" ! version="1.2" ! description="Microsoft .NET Framework 1.2" ! runtimeengine="" ! sdkdirectory="${sdkInstallRoot}bin" ! frameworkdirectory="${installRoot}v${clrversion}" ! frameworkassemblydirectory="${installRoot}v${clrversion}" ! clrversion="${clrversion}" ! > ! <extensions> ! <includes name="*Tasks.dll" /> ! <includes name="*Tests.dll" /> ! </extensions> <properties> ! <property name="clrversion" value="1.2.30703" /> ! <property name="sdkInstallRoot" useregistry="true" regkey="SOFTWARE\Microsoft\.NETFramework" regvalue="sdkInstallRootv1.2" /> ! <property name="installRoot" useregistry="true" regkey="SOFTWARE\Microsoft\.NETFramework" regvalue="InstallRoot" /> </properties> <tasks> *************** *** 126,140 **** <attribute name="useruntimeengine">false</attribute> </task> </tasks> </framework> ! <framework name="netcf-1.0" description="Microsoft .Net Compact Framework Framework 1.0" version="${version}" ! runtimeengine="" sdkdirectory="${sdkInstallRoot}v${version}\bin" frameworkdirectory="${installRoot}v1.1.4322" ! frameworkassemblydirectory="${sdkInstallRoot}v${version}\Windows CE"> <properties> ! <property name="version" value="1.0.5000" /> ! <property name="sdkInstallRoot" useregistry="true" regkey="SOFTWARE\Microsoft\.NETCompactFramework" ! regvalue="sdkInstallRoot" /> ! <property name="installRoot" useregistry="true" regkey="SOFTWARE\Microsoft\.NETFramework" ! regvalue="InstallRoot" /> </properties> <tasks> --- 167,194 ---- <attribute name="useruntimeengine">false</attribute> </task> + <task name="delay-sign"> + <attribute name="exename">sn</attribute> + <attribute name="useruntimeengine">false</attribute> + </task> </tasks> </framework> ! <framework ! name="netcf-1.0" ! family="netcf" ! version="1.0" ! description="Microsoft .NET Compact Framework 1.0" ! runtimeengine="" ! sdkdirectory="${sdkInstallRoot}v1.0.5000\bin" ! frameworkdirectory="${installRoot}v${clrversion}" ! frameworkassemblydirectory="${sdkInstallRoot}v1.0.5000\Windows CE" ! clrversion="${clrversion}" ! > ! <extensions> ! <!-- this is not a supported runtime framework --> ! </extensions> <properties> ! <property name="clrversion" value="1.1.4322" /> ! <property name="sdkInstallRoot" useregistry="true" regkey="SOFTWARE\Microsoft\.NETCompactFramework" regvalue="sdkInstallRoot" /> ! <property name="installRoot" useregistry="true" regkey="SOFTWARE\Microsoft\.NETFramework" regvalue="InstallRoot" /> </properties> <tasks> *************** *** 163,177 **** </tasks> </framework> ! <framework name="mono-1.0" description="GNOME projects port of the .NET Framework" version="${version}" ! runtimeengine="mono.exe" sdkdirectory="${sdkInstallRoot}\bin" frameworkdirectory="${sdkInstallRoot}\bin" ! frameworkassemblydirectory="${frameworkAssemblyDirectory}"> <properties> ! <property name="version" value="0.28" /> ! <property name="sdkInstallRoot" useregistry="true" regkey="SOFTWARE\Mono\${version}" regvalue="SdkInstallRoot" /> ! <property name="frameworkAssemblyDirectory" useregistry="true" regkey="SOFTWARE\Mono\${version}" regvalue="FrameworkAssemblyDirectory" /> ! <property name="configDir" useregistry="true" regkey="SOFTWARE\Mono\${version}" regvalue="MonoConfigDir" /> </properties> <environment> ! <env name="PATH" path="${frameworkAssemblyDirectory};%PATH%" /> <env name="MONO_BASEPATH" path="${sdkInstallRoot};%MONO_BASEPATH%" /> <env name="MONO_PATH" path="${frameworkAssemblyDirectory};%MONO_PATH%" /> --- 217,248 ---- </tasks> </framework> ! <framework ! name="mono-1.0" ! family="mono" ! version="1.0" ! description="GNOME projects port of the .NET Framework" ! runtimeengine="mono.exe" ! sdkdirectory="${sdkInstallRoot}\bin" ! frameworkdirectory="${sdkInstallRoot}\bin" ! frameworkassemblydirectory="${frameworkAssemblyDirectory}" ! clrversion="${clrversion}" ! > ! <extensions> ! <includes name="*Tasks.dll" /> ! <includes name="*Tests.dll" /> ! <!-- exclude Microsoft.NET specific extension assembly --> ! <excludes name="NAnt.MSNetTasks.dll" /> ! <!-- exclude Microsoft.NET specific test assembly --> ! <excludes name="NAnt.MSNet.Tests.dll" /> ! </extensions> <properties> ! <property name="internalversion" value="0.31" /> ! <property name="clrversion" value="1.1.4322" /> ! <property name="sdkInstallRoot" useregistry="true" regkey="SOFTWARE\Mono\${internalversion}" regvalue="SdkInstallRoot" /> ! <property name="frameworkAssemblyDirectory" useregistry="true" regkey="SOFTWARE\Mono\${internalversion}" regvalue="FrameworkAssemblyDirectory" /> ! <property name="configDir" useregistry="true" regkey="SOFTWARE\Mono\${internalversion}" regvalue="MonoConfigDir" /> </properties> <environment> ! <env name="PATH" path="${frameworkAssemblyDirectory};${sdkInstallRoot}\icu\bin;%PATH%" /> <env name="MONO_BASEPATH" path="${sdkInstallRoot};%MONO_BASEPATH%" /> <env name="MONO_PATH" path="${frameworkAssemblyDirectory};%MONO_PATH%" /> *************** *** 179,182 **** --- 250,257 ---- </environment> <tasks> + <task name="al"> + <attribute name="exename">al</attribute> + <attribute name="useruntimeengine">true</attribute> + </task> <task name="csc"> <attribute name="exename">mcs</attribute> *************** *** 197,205 **** </tasks> </framework> ! <framework name="sscli-1.0" description="Microsoft Shared Source CLI 1.0" version="${version}" ! runtimeengine="clix.exe" sdkdirectory="C:\sscli\build\v1.x86fstchk.rotor\sdk\bin" frameworkdirectory="C:\sscli\build\v1.x86fstchk.rotor" ! frameworkassemblydirectory="C:\sscli\build\v1.x86fstchk.rotor"> <properties> ! <property name="version" value="1.0.0000" /> </properties> <tasks> --- 272,291 ---- </tasks> </framework> ! <framework ! name="sscli-1.0" ! family="sscli" ! version="1.0" ! description="Microsoft Shared Source CLI 1.0" ! runtimeengine="clix.exe" ! sdkdirectory="C:\sscli\build\v1.x86fstchk.rotor\sdk\bin" ! frameworkdirectory="C:\sscli\build\v1.x86fstchk.rotor" ! frameworkassemblydirectory="C:\sscli\build\v1.x86fstchk.rotor" ! clrversion="${clrversion}" ! > ! <extensions> ! <!-- this is not a supported runtime framework --> ! </extensions> <properties> ! <property name="clrversion" value="1.0.3" /> </properties> <tasks> *************** *** 227,238 **** </framework> </platform> ! <platform name="unix" default="mono-1.0"> ! <framework name="mono-1.0" description="GNOME projects port of the .NET Framework" version="${version}" ! runtimeengine="mono" sdkdirectory="/usr/local/bin" frameworkdirectory="/usr/local/bin" ! frameworkassemblydirectory="/usr/local/lib"> <properties> ! <property name="version" value="0.28" /> </properties> <tasks> <task name="csc"> <attribute name="exename">mcs</attribute> --- 313,348 ---- </framework> </platform> ! <platform name="unix" default="auto"> ! <framework ! name="mono-1.0" ! family="mono" ! version="1.0" ! description="GNOME projects port of the .NET Framework" ! runtimeengine="mono" ! sdkdirectory="/usr/local/bin" ! frameworkdirectory="/usr/local/bin" ! frameworkassemblydirectory="/usr/local/lib" ! clrversion="${clrversion}" ! > ! <extensions> ! <includes name="*Tasks.dll" /> ! <includes name="*Tests.dll" /> ! <!-- exclude Microsoft.NET specific extension assembly --> ! <excludes name="NAnt.MSNetTasks.dll" /> ! <!-- exclude Microsoft.NET specific test assembly --> ! <excludes name="NAnt.MSNet.Tests.dll" /> ! <!-- exclude win32 specific extension assembly --> ! <excludes name="NAnt.Win32Tasks.dll" /> ! <!-- exclude win32 specific test assembly --> ! <excludes name="NAnt.Win32.Tests.dll" /> ! </extensions> <properties> ! <property name="clrversion" value="1.1.4322" /> </properties> <tasks> + <task name="al"> + <attribute name="exename">al</attribute> + <attribute name="useruntimeengine">true</attribute> + </task> <task name="csc"> <attribute name="exename">mcs</attribute> *************** *** 317,321 **** </log4net> <startup> ! <supportedRuntime version="v1.1.4322" /> <supportedRuntime version="v1.0.3705" /> </startup> --- 427,431 ---- </log4net> <startup> ! <supportedRuntime version="v1.1.4322" /> <supportedRuntime version="v1.0.3705" /> </startup> Index: NAnt.VSNetTasks.dll =================================================================== RCS file: /cvsroot/nmock/nmock/tools/NAnt.VSNetTasks.dll,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsyTiXxs and /tmp/cvszSnb9I differ Index: NAnt.SourceControlTasks.dll =================================================================== RCS file: /cvsroot/nmock/nmock/tools/NAnt.SourceControlTasks.dll,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvs6yK0Lw and /tmp/cvshYJ5oN differ Index: NAnt.NUnit2Tasks.dll =================================================================== RCS file: /cvsroot/nmock/nmock/tools/NAnt.NUnit2Tasks.dll,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvsIkY93A and /tmp/cvsxeBwIR differ Index: NAnt.DotNetTasks.dll =================================================================== RCS file: /cvsroot/nmock/nmock/tools/NAnt.DotNetTasks.dll,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvs0yeqWy and /tmp/cvsj9myHP differ Index: NDoc.Documenter.Msdn.dll =================================================================== RCS file: /cvsroot/nmock/nmock/tools/NDoc.Documenter.Msdn.dll,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsUFoxWD and /tmp/cvsBC2WKU differ Index: NDoc.Core.dll =================================================================== RCS file: /cvsroot/nmock/nmock/tools/NDoc.Core.dll,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvsgPf9BL and /tmp/cvsWyhau2 differ --- NAnt.NUnit2Tasks.xml DELETED --- --- log4net-net-1.0.dll DELETED --- Index: ICSharpCode.SharpCvsLib.dll =================================================================== RCS file: /cvsroot/nmock/nmock/tools/ICSharpCode.SharpCvsLib.dll,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvs10IaAM and /tmp/cvs0mXlu3 differ --- NAnt.Core.xml DELETED --- Index: NAnt.NUnit.dll =================================================================== RCS file: /cvsroot/nmock/nmock/tools/NAnt.NUnit.dll,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvspuhq6R and /tmp/cvsNbE418 differ Index: NAnt.Win32Tasks.dll =================================================================== RCS file: /cvsroot/nmock/nmock/tools/NAnt.Win32Tasks.dll,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsaPomrR and /tmp/cvseDBfo8 differ Index: NAnt.ZipTasks.dll =================================================================== RCS file: /cvsroot/nmock/nmock/tools/NAnt.ZipTasks.dll,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsX3rIDX and /tmp/cvs5iH0Ce differ Index: NDoc.Documenter.NAnt.dll =================================================================== RCS file: /cvsroot/nmock/nmock/tools/NDoc.Documenter.NAnt.dll,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsRXn0QZ and /tmp/cvsDB1eSg differ --- NAnt.DotNetTasks.xml DELETED --- Index: nant.exe =================================================================== RCS file: /cvsroot/nmock/nmock/tools/nant.exe,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvsWmLzy4 and /tmp/cvsRpcmCl differ --- NAnt.xml DELETED --- Index: NAnt.VisualCppTasks.dll =================================================================== RCS file: /cvsroot/nmock/nmock/tools/NAnt.VisualCppTasks.dll,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsLRs4c7 and /tmp/cvsbT2Jio differ |
|
From: Owen R. <OR...@th...> - 2004-03-23 08:02:20
|
skizz and i have just checked in a new class called MockContainer. MockContainer springs from our observations about doing mock-driven development with constructor dependency injection (http://www.martinfowler.com/articles/injection.html). the basic idea is that you can use the MockContainer to instantiate your class-under-test and it will go and create and plug in your mocks for you a la picocontainer (http://picocontainer.org/). managing multiple mocks for a single class-under-test and ensuring that they are all verified can be a bit of pain. it is very easy to forget to verify a particular mock, and you have all of these mock members kicking around in your test case. enter MockContainer which manages all of this for you by dynamically determining the dependencies expected by your class-under-test. MockContainer uses reflection to automatically generate mocks for every constructor argument in the class-under-test. you can then ask the MockContainer for an instance of the class-under-test and it will create it by passing in the requisite mocks. calling Verify on the MockContainer will ensure that Verify is called on each of the created mocks. try it out and let us know what you think. i have also included a patch submitted by Jie Wang and Levi Khatskevitch. they fixed a problem with SetupResult where it wasn't properly verifying the return type of methods inherited from an interface <snip from="Jie's email"> What happens is when an interface inherits from another parent interface, the methods which belong to parent interface won't be returned through Type.GetMethod method. We have to track its parent path to find the return type. </snip> lastly, i have updated the loginfo in CVSROOT to use the centralised version of syncmail. the local copy in CVSROOT was blowing up due to some security changes made by sourceforge. commitinfo emails should now be coming out on the nmock mailing list again. cheers, owen. --- R. Owen Rogers ThoughtWorks Technologies (India) Pvt Ltd. ThoughtWorks - Deliver with passion! ThoughtWorks is always looking for talented people who are passionate about technology. To find out more about a career at ThoughtWorks go to http://www.thoughtworks.com/career/. |
|
From: Mike B. <mi...@fr...> - 2004-03-07 20:45:21
|
I'm beginning a project to create a .NET mini-language for performing data transformations. I'm currently debating which of following would be best: A) compile the language into a data structure that is used by a runtime engine to perform the transformations B) compile the language into C# code that performs the transformations (after a second compilation) C) compile the language directly to MSIL that performs the transformations Here's a breakdown of how I see these approaches comparing based on 3 criteria: ease of implementation, execution speed, and compilation speed Option Implementation execution compilation ------------------------------------------------- A easy slow fast B medium fast slow C hard fast medium I'm currently leaning towards C, because a) it appears to have the best trade off between execution and compilation speed b) it is the approach taken by XSLTC (albeit in Java) and NMock, and c) it sounds like fun. Would the designers of NMock care to share their thoughts on that decision? How hard has it been do create a MSIL generator? What issues did you run into? How fun has it been? Mike Bresnahan |
|
From: Steve F. <st...@m3...> - 2004-02-11 23:06:01
|
An interesting idea, but could you do more to make the current case more
readable, like having a more explanatory test name:
SetsCategoryInViewFromCategoryProviderForGivenName
Also, you can set the name of the Mock if the class isn't explanatory
enough.
S.
Nick Robinson wrote:
> I am wondering what peoples thoughts are on commentable Verify calls to the
> mock object? It seems I sometimes feel a little more information would be
> extremely beneficial, especially if more than one mock object is involved in
> a set of object messages:
>
> [Test]
> public void SelectCategory()
> {
> _view.Expect("SetCategories", _computers.SubCategories);
> _categoryProviderMock.ExpectAndReturn("Find", _computers.SubCategories,
> "Computers");
> _controller.SelectCategory("Computers");
>
> _view.Verify("The controller has not called back into the view");
> _categoryProviderMock.Verify();
> }
>
> In this instance, albeit simple, the message goes a long way in explaining
> the failure better to the reader (at least I think so).
|
|
From: Nick R. <nic...@fr...> - 2004-02-11 19:03:28
|
Hi,
I am wondering what peoples thoughts are on commentable Verify calls to the
mock object? It seems I sometimes feel a little more information would be
extremely beneficial, especially if more than one mock object is involved in
a set of object messages:
[Test]
public void SelectCategory()
{
_view.Expect("SetCategories", _computers.SubCategories);
_categoryProviderMock.ExpectAndReturn("Find", _computers.SubCategories,
"Computers");
_controller.SelectCategory("Computers");
_view.Verify("The controller has not called back into the view");
_categoryProviderMock.Verify();
}
In this instance, albeit simple, the message goes a long way in explaining
the failure better to the reader (at least I think so).
Just curious...
nick.robinson
site : www.fromconcept.co.uk
blog : www.fromconcept.co.uk/weblog.aspx
|
|
From: Jim A. <JA...@th...> - 2004-01-20 16:57:19
|
>But I'm guessing this is not possible >because NMock does not work by replacing a class, but rather by deriving the >mock class from the real class and overriding all virtual functions. Is >this correct? Correct. NMock does nothing you can't do yourself with subclassing, it just makes it easier. >Is the constructor necessary because you can't mock the >non-virtual functions and thus they might access non-public data members >which might not be initialized? Exactly. Partially mocked types might not work "as advertised". I think I've reached the conclusion that a choice is needed - if you want to construct the base, pass parameters in (Chris' suggestion for the API looks reasonable), otherwise NMock will just give you a derived object with an uninitialised base. Jim |---------+----------------------------> | | "Mike Bresnahan" | | | <mbr...@vi...| | | m> | | | | | | 20/01/2004 15:13 | | | | |---------+----------------------------> >------------------------------------------------------------------------------------------------------------------------------| | | | To: "Jim Arnold" <JA...@th...> | | cc: <nmo...@li...>, <nmo...@li...> | | Subject: RE: [Nmock-general] Mocking types with constructors | >------------------------------------------------------------------------------------------------------------------------------| I didn't mean physically create only one mock class. I meant logically. If the class to mock has 1 base class then obviously you must create 2 mock classes; one for each real class. But I'm guessing this is not possible because NMock does not work by replacing a class, but rather by deriving the mock class from the real class and overriding all virtual functions. Is this correct? Even if that is true you can still override the virtual functions in the base class as well as the derived class, so why do you need the constructor? Is the constructor necessary because you can't mock the non-virtual functions and thus they might access non-public data members which might not be initialized? The package swapping idea is intriguing. I had considered something similar once as a way to mock C functions by swapping .o files. Mike > -----Original Message----- > From: Jim Arnold [mailto:JA...@th...] > Sent: Tuesday, January 20, 2004 4:21 AM > To: mbr...@vi... > Subject: RE: [Nmock-general] Mocking types with constructors > > > > > > > >Is an object with a mock derived class but real base class really a mock > >object? Shouldn't it be all or nothing? What good is a hybrid? > > There's really no other way to do it*. If a method is expecting > a concrete > type, as opposed to an interface type, the object you pass in must be at > least that type. It therefore must contain all the fields and members of > that type "below" its own fields and methods. You cannot > substitute it for > an interface, given the rules of the .Net type system. > > >It seems more useful to me to treat the class and its base clases as a > >single interface and create a mock implementation of that interface > >replacing the real implementation. > > Again, though, the code under test would have no prior knowledge of this > new interface, and would not accept it. > > > *There are actually a couple of ways to do this, but both are difficult to > implement and bring their own set of problems. First, we could use the > unmanaged profiling API to intercept method calls to real objects, or > modify the bytecode of a real class at JIT-compile time to call > out to some > auditing code. I actually started doing this last year, but abandoned it > because a) it requires some pretty hairy C++ and b) it req uires some COM > and environment variable magic that would make mocking a more tedious > excercise than the current, fairly intuitive NMock style. > > Second, we could generate a "mock assembly" that looks and smells like a > real assembly, but has some or all of its classes stubbed out as auditable > mocks. We then change references to point to this new assembly, and the > code under test is none the wiser. There is a commercial tool by Pretty > Objects, called POCMock, which does this. Again, I spiked this last year, > but ran into some limitations of the Reflection APIs. Pretty > Objects use a > proprietary assembly reader/writer, so it's doable, but non-trivial. > > Jim > |
|
From: Mike B. <mbr...@vi...> - 2004-01-20 15:13:58
|
I didn't mean physically create only one mock class. I meant logically. If the class to mock has 1 base class then obviously you must create 2 mock classes; one for each real class. But I'm guessing this is not possible because NMock does not work by replacing a class, but rather by deriving the mock class from the real class and overriding all virtual functions. Is this correct? Even if that is true you can still override the virtual functions in the base class as well as the derived class, so why do you need the constructor? Is the constructor necessary because you can't mock the non-virtual functions and thus they might access non-public data members which might not be initialized? The package swapping idea is intriguing. I had considered something similar once as a way to mock C functions by swapping .o files. Mike > -----Original Message----- > From: Jim Arnold [mailto:JA...@th...] > Sent: Tuesday, January 20, 2004 4:21 AM > To: mbr...@vi... > Subject: RE: [Nmock-general] Mocking types with constructors > > > > > > > >Is an object with a mock derived class but real base class really a mock > >object? Shouldn't it be all or nothing? What good is a hybrid? > > There's really no other way to do it*. If a method is expecting > a concrete > type, as opposed to an interface type, the object you pass in must be at > least that type. It therefore must contain all the fields and members of > that type "below" its own fields and methods. You cannot > substitute it for > an interface, given the rules of the .Net type system. > > >It seems more useful to me to treat the class and its base clases as a > >single interface and create a mock implementation of that interface > >replacing the real implementation. > > Again, though, the code under test would have no prior knowledge of this > new interface, and would not accept it. > > > *There are actually a couple of ways to do this, but both are difficult to > implement and bring their own set of problems. First, we could use the > unmanaged profiling API to intercept method calls to real objects, or > modify the bytecode of a real class at JIT-compile time to call > out to some > auditing code. I actually started doing this last year, but abandoned it > because a) it requires some pretty hairy C++ and b) it req uires some COM > and environment variable magic that would make mocking a more tedious > excercise than the current, fairly intuitive NMock style. > > Second, we could generate a "mock assembly" that looks and smells like a > real assembly, but has some or all of its classes stubbed out as auditable > mocks. We then change references to point to this new assembly, and the > code under test is none the wiser. There is a commercial tool by Pretty > Objects, called POCMock, which does this. Again, I spiked this last year, > but ran into some limitations of the Reflection APIs. Pretty > Objects use a > proprietary assembly reader/writer, so it's doable, but non-trivial. > > Jim > |
|
From: Mike B. <mbr...@vi...> - 2004-01-20 15:00:42
|
-----Original Message----- From: Jim Arnold [mailto:JA...@th...] Sent: Tuesday, January 20, 2004 4:21 AM To: mbr...@vi... Subject: RE: [Nmock-general] Mocking types with constructors >Is an object with a mock derived class but real base class really a mock >object? Shouldn't it be all or nothing? What good is a hybrid? There's really no other way to do it*. If a method is expecting a concrete type, as opposed to an interface type, the object you pass in must be at least that type. It therefore must contain all the fields and members of that type "below" its own fields and methods. You cannot substitute it for an interface, given the rules of the .Net type system. >It seems more useful to me to treat the class and its base clases as a >single interface and create a mock implementation of that interface >replacing the real implementation. Again, though, the code under test would have no prior knowledge of this new interface, and would not accept it. *There are actually a couple of ways to do this, but both are difficult to implement and bring their own set of problems. First, we could use the unmanaged profiling API to intercept method calls to real objects, or modify the bytecode of a real class at JIT-compile time to call out to some auditing code. I actually started doing this last year, but abandoned it because a) it requires some pretty hairy C++ and b) it req uires some COM and environment variable magic that would make mocking a more tedious excercise than the current, fairly intuitive NMock style. Second, we could generate a "mock assembly" that looks and smells like a real assembly, but has some or all of its classes stubbed out as auditable mocks. We then change references to point to this new assembly, and the code under test is none the wiser. There is a commercial tool by Pretty Objects, called POCMock, which does this. Again, I spiked this last year, but ran into some limitations of the Reflection APIs. Pretty Objects use a proprietary assembly reader/writer, so it's doable, but non-trivial. Jim |---------+----------------------------> | | "Mike Bresnahan" | | | <mbr...@vi...| | | m> | | | | | | 19/01/2004 18:07 | | | | |---------+----------------------------> >--------------------------------------------------------------------------- ---------------------------------------------------| | | | To: "'Jim Arnold'" <JA...@th...> | | cc: <nmo...@li...>, <nmo...@li...> | | Subject: RE: [Nmock-general] Mocking types with constructors | >--------------------------------------------------------------------------- ---------------------------------------------------| Was that feature added to Nmock recently? Does it also exist in the Java mock objects framework? I have used both and didn't know such a feature existed in either. Is an object with a mock derived class but real base class really a mock object? Shouldn't it be all or nothing? What good is a hybrid? It seems more useful to me to treat the class and its base clases as a single interface and create a mock implementation of that interface replacing the real implementation. Please explain your reasoning. Mike > -----Original Message----- > From: Jim Arnold [mailto:JA...@th...] > Sent: Monday, January 19, 2004 11:44 AM > To: mbr...@vi... > Cc: nmo...@li...; > nmo...@li... > Subject: RE: [Nmock-general] Mocking types with constructors > > > > > > > Yes, currently NMock allows you to mock classes with empty > constructors. You get back a subclass with a real class as > its base. What I'm proposing is to remove the limitation on > empty constructors by either *not* calling any constructor on > the base, or by allowing the user to pass parameters into > GetMockInstance() which would be used to construct the base with. > > Jim > |
|
From: Jim A. <JA...@th...> - 2004-01-20 13:42:54
|
>Is an object with a mock derived class but real base class really a mock >object? Shouldn't it be all or nothing? What good is a hybrid? There's really no other way to do it*. If a method is expecting a concrete type, as opposed to an interface type, the object you pass in must be at least that type. It therefore must contain all the fields and members of that type "below" its own fields and methods. You cannot substitute it for an interface, given the rules of the .Net type system. >It seems more useful to me to treat the class and its base clases as a >single interface and create a mock implementation of that interface >replacing the real implementation. Again, though, the code under test would have no prior knowledge of this new interface, and would not accept it. *There are actually a couple of ways to do this, but both are difficult to implement and bring their own set of problems. First, we could use the unmanaged profiling API to intercept method calls to real objects, or modify the bytecode of a real class at JIT-compile time to call out to some auditing code. I actually started doing this last year, but abandoned it because a) it requires some pretty hairy C++ and b) it req uires some COM and environment variable magic that would make mocking a more tedious excercise than the current, fairly intuitive NMock style. Second, we could generate a "mock assembly" that looks and smells like a real assembly, but has some or all of its classes stubbed out as auditable mocks. We then change references to point to this new assembly, and the code under test is none the wiser. There is a commercial tool by Pretty Objects, called POCMock, which does this. Again, I spiked this last year, but ran into some limitations of the Reflection APIs. Pretty Objects use a proprietary assembly reader/writer, so it's doable, but non-trivial. Jim |---------+----------------------------> | | "Mike Bresnahan" | | | <mbr...@vi...| | | m> | | | | | | 19/01/2004 18:07 | | | | |---------+----------------------------> >------------------------------------------------------------------------------------------------------------------------------| | | | To: "'Jim Arnold'" <JA...@th...> | | cc: <nmo...@li...>, <nmo...@li...> | | Subject: RE: [Nmock-general] Mocking types with constructors | >------------------------------------------------------------------------------------------------------------------------------| Was that feature added to Nmock recently? Does it also exist in the Java mock objects framework? I have used both and didn't know such a feature existed in either. Is an object with a mock derived class but real base class really a mock object? Shouldn't it be all or nothing? What good is a hybrid? It seems more useful to me to treat the class and its base clases as a single interface and create a mock implementation of that interface replacing the real implementation. Please explain your reasoning. Mike > -----Original Message----- > From: Jim Arnold [mailto:JA...@th...] > Sent: Monday, January 19, 2004 11:44 AM > To: mbr...@vi... > Cc: nmo...@li...; > nmo...@li... > Subject: RE: [Nmock-general] Mocking types with constructors > > > > > > > Yes, currently NMock allows you to mock classes with empty > constructors. You get back a subclass with a real class as > its base. What I'm proposing is to remove the limitation on > empty constructors by either *not* calling any constructor on > the base, or by allowing the user to pass parameters into > GetMockInstance() which would be used to construct the base with. > > Jim > |
|
From: Chris S. <sk...@sk...> - 2004-01-19 21:45:34
|
Mike Bresnahan wrote: >Was that feature added to Nmock recently? Does it also exist in the Java >mock objects framework? I have used both and didn't know such a feature >existed in either. > > It has always been in NMock although I think overusing this approach is probably a Bad Thing - interfaces are better. In terms of the semantics though, I would suggest that the constructor could be called when the mock is created : IMock mock = new DynamicMock(typeof(ClassWithFatConstructor), param1, param2, param3); since we can only initialize the instance once, and it is possible and legal to re-use the mock instance: a.Foo = mock.MockInstance b.Bar = mock.MockInstance Note that in this case there is still only 1 underlying mock object, not 2. Alternatively, we could introduce an explicit CallConstructor() method? DynamicMock mock = new DynamicMock(typeof(ClassWithFatConstructor)); mock.Construct(p1, 2, p3); and it would then be an error to call this method more than once. I prefer the first option though chris |
|
From: Mike B. <mbr...@vi...> - 2004-01-19 18:07:24
|
Was that feature added to Nmock recently? Does it also exist in the Java mock objects framework? I have used both and didn't know such a feature existed in either. Is an object with a mock derived class but real base class really a mock object? Shouldn't it be all or nothing? What good is a hybrid? It seems more useful to me to treat the class and its base clases as a single interface and create a mock implementation of that interface replacing the real implementation. Please explain your reasoning. Mike > -----Original Message----- > From: Jim Arnold [mailto:JA...@th...] > Sent: Monday, January 19, 2004 11:44 AM > To: mbr...@vi... > Cc: nmo...@li...; > nmo...@li... > Subject: RE: [Nmock-general] Mocking types with constructors > > > > > > > Yes, currently NMock allows you to mock classes with empty > constructors. You get back a subclass with a real class as > its base. What I'm proposing is to remove the limitation on > empty constructors by either *not* calling any constructor on > the base, or by allowing the user to pass parameters into > GetMockInstance() which would be used to construct the base with. > > Jim > |