|
From: <exo...@us...> - 2003-03-13 20:11:57
|
Update of /cvsroot/nmock/nmock/src/NMock
In directory sc8-pr-cvs1:/tmp/cvs-serv32599/src/NMock
Modified Files:
Method.cs
Log Message:
fixed MockNoCall bug
Index: Method.cs
===================================================================
RCS file: /cvsroot/nmock/nmock/src/NMock/Method.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Method.cs 13 Mar 2003 19:52:44 -0000 1.2
--- Method.cs 13 Mar 2003 20:11:51 -0000 1.3
***************
*** 60,64 ****
// TODO: iterate through and verify every call. delegate verification to call instance
Mock.Assertion.AssertEquals(name + "() " + CallCountErrorMessage(),
! expectations.Count, timesCalled);
}
--- 60,64 ----
// TODO: iterate through and verify every call. delegate verification to call instance
Mock.Assertion.AssertEquals(name + "() " + CallCountErrorMessage(),
! expectations.CountExpectedCalls, timesCalled);
}
***************
*** 95,98 ****
--- 95,115 ----
get { return sequence.Count; }
}
+
+ public int CountExpectedCalls
+ {
+ get
+ {
+ int count = 0;
+ for (int i = 0; i < sequence.Count; i++)
+ {
+ if (! (sequence[i] is MockNoCall))
+ {
+ count++;
+ }
+ }
+ return count;
+ }
+ }
+
public void Add(MockCall aCall)
{
|