|
From: <sm...@us...> - 2003-08-13 21:00:34
|
Update of /cvsroot/nmock/nmock/test/NMock/Dynamic
In directory sc8-pr-cvs1:/tmp/cvs-serv8466/test/NMock/Dynamic
Modified Files:
ClassGeneratorTest.cs
Log Message:
Pushed parameters into fields in ClassGenerator
Moved superclassIfTypeIsAnInterface into field
Removed RemotingClasssGenerator
Index: ClassGeneratorTest.cs
===================================================================
RCS file: /cvsroot/nmock/nmock/test/NMock/Dynamic/ClassGeneratorTest.cs,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** ClassGeneratorTest.cs 13 Aug 2003 19:42:37 -0000 1.12
--- ClassGeneratorTest.cs 13 Aug 2003 20:44:12 -0000 1.13
***************
*** 95,101 ****
[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);
--- 95,101 ----
[Test] public void CreateGenericProxy()
{
InvocationHandlerImpl handler = new InvocationHandlerImpl();
! ClassGenerator cg = new ClassGenerator(typeof(IThingy), handler);
! IThingy thingy = (IThingy)cg.Generate();
thingy.NoArgs();
Assertion.AssertEquals("NoArgs", handler.invokedMethodName);
***************
*** 111,117 ****
[SetUp] public void SetUp()
{
- cg = new ClassGenerator();
mock = new Mock("Test Mock");
! thingy = (IThingy)cg.Generate(typeof(IThingy), mock);
}
--- 111,117 ----
[SetUp] public void SetUp()
{
mock = new Mock("Test Mock");
! cg = new ClassGenerator(typeof(IThingy), mock);
! thingy = (IThingy)cg.Generate();
}
***************
*** 289,294 ****
[Test] public void CanExtendAbstractClass()
{
! cg = new ClassGenerator();
! AbstractThingy s = (AbstractThingy)cg.Generate(typeof(AbstractThingy), mock);
mock.ExpectAndReturn("VirtualMethod", "hello");
--- 289,294 ----
[Test] public void CanExtendAbstractClass()
{
! cg = new ClassGenerator(typeof(AbstractThingy), mock);
! AbstractThingy s = (AbstractThingy)cg.Generate();
mock.ExpectAndReturn("VirtualMethod", "hello");
***************
*** 324,328 ****
[Test] public void CanExtendConcreteClass()
{
! ConcreteThing concrete = (ConcreteThing)(new ClassGenerator()).Generate(typeof(ConcreteThing), mock);
mock.Expect("NoArgs");
--- 324,328 ----
[Test] public void CanExtendConcreteClass()
{
! ConcreteThing concrete = (ConcreteThing)(new ClassGenerator(typeof(ConcreteThing), mock)).Generate();
mock.Expect("NoArgs");
***************
*** 334,339 ****
[Test] public void CannotOverrideNonVirtualFeatures()
{
! cg = new ClassGenerator();
! AbstractThingy s = (AbstractThingy)cg.Generate(typeof(AbstractThingy), mock);
mock.SetupResult("NonVirtualMethod", "non virtual method");
--- 334,339 ----
[Test] public void CannotOverrideNonVirtualFeatures()
{
! cg = new ClassGenerator(typeof(AbstractThingy), mock);
! AbstractThingy s = (AbstractThingy)cg.Generate();
mock.SetupResult("NonVirtualMethod", "non virtual method");
***************
*** 347,352 ****
[Test] public void DoesNotOverrideToString()
{
! cg = new ClassGenerator();
! AbstractThingy s = (AbstractThingy)cg.Generate(typeof(AbstractThingy), mock);
mock.SetupResult("ToString", "to string");
--- 347,352 ----
[Test] public void DoesNotOverrideToString()
{
! cg = new ClassGenerator(typeof(AbstractThingy), mock);
! AbstractThingy s = (AbstractThingy)cg.Generate();
mock.SetupResult("ToString", "to string");
***************
*** 358,362 ****
[Test] [ExpectedException(typeof(TypeLoadException))] public void CannotMockClassWithInternalMethodBecauseOfAssemblyVisibility()
{
! new ClassGenerator().Generate(typeof(ClassWithInternalMethod), mock);
}
--- 358,362 ----
[Test] [ExpectedException(typeof(TypeLoadException))] public void CannotMockClassWithInternalMethodBecauseOfAssemblyVisibility()
{
! new ClassGenerator(typeof(ClassWithInternalMethod), mock).Generate();
}
|