|
From: <joe...@us...> - 2002-12-12 21:39:47
|
Update of /cvsroot/nmock/nmock/test/NMock
In directory sc8-pr-cvs1:/tmp/cvs-serv18108/test/NMock
Modified Files:
DynamicMockTest.cs
Log Message:
Forgotten whatever the hell it is we've done (but Steve did some too)
Index: DynamicMockTest.cs
===================================================================
RCS file: /cvsroot/nmock/nmock/test/NMock/DynamicMockTest.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DynamicMockTest.cs 15 Nov 2002 22:31:10 -0000 1.3
--- DynamicMockTest.cs 12 Dec 2002 21:39:44 -0000 1.4
***************
*** 78,81 ****
--- 78,111 ----
}
}
+
+ [Test]
+ public void MockOfClassUsedAsExpectation()
+ {
+ DynamicMock m1 = new DynamicMock(typeof(Thingy));
+ Thingy b = (Thingy)m1.MockInstance;
+ Mock m2 = new Mock("x");
+
+ m2.Expect("y", b);
+ m2.Call("y", b);
+ m2.Verify();
+ }
+
+ [Test]
+ [ExpectedException(typeof(VerifyException))]
+ public void MockOfClassUsedAsFailedExpectation()
+ {
+ DynamicMock m1 = new DynamicMock(typeof(Thingy));
+ Thingy b = (Thingy)m1.MockInstance;
+ Mock m2 = new Mock("x");
+
+ m2.Expect("y", b);
+ m2.Call("y", "something else");
+ m2.Verify();
+ }
+
+ public class Thingy
+ {
+ public void X() {}
+ }
}
}
|