|
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);
}
|