SPRNET-1367 - Remove dependency of unit tests on DotNetMock framework

Start Spring.Aop.Tests
This commit is contained in:
markpollack
2010-09-21 13:13:54 +00:00
parent b9d38ec34e
commit dac1c093c9

View File

@@ -46,6 +46,15 @@ namespace Spring.Aop.Framework
[TestFixture]
public sealed class ProxyFactoryTests
{
private MockRepository mocks;
[SetUp]
public void Setup()
{
mocks = new MockRepository();
}
public interface IDoubleClickable
{
event EventHandler DoubleClick;
@@ -516,14 +525,21 @@ namespace Spring.Aop.Framework
[Test]
public void AddAdvisedSupportListener()
{
IDynamicMock mock = new DynamicMock(typeof(IAdvisedSupportListener));
IAdvisedSupportListener listener = (IAdvisedSupportListener)mock.Object;
//MLP SPRNET-1367
//IDynamicMock mock = new DynamicMock(typeof(IAdvisedSupportListener));
//IAdvisedSupportListener listener = (IAdvisedSupportListener)mock.Object;
IAdvisedSupportListener listener =
(IAdvisedSupportListener) mocks.CreateMock(typeof (IAdvisedSupportListener));
listener.Activated(null);
LastCall.On(listener).IgnoreArguments();
//listener.Activated();
//mock.Expect("Activated");
mock.Expect("Activated");
mocks.ReplayAll();
ProxyFactory factory = new ProxyFactory(new TestObject());
factory.AddListener(listener);
factory.GetProxy();
mock.Verify();
mocks.VerifyAll();
}
[Test]