public void RemoveAdvisedSupportListener()
        {
            IDynamicMock            mock     = new DynamicMock(typeof(IAdvisedSupportListener));
            IAdvisedSupportListener listener = (IAdvisedSupportListener)mock.Object;

            ProxyFactory factory = new ProxyFactory(new TestObject());

            factory.AddListener(listener);
            factory.RemoveListener(listener);

            factory.GetProxy();

            // check that no lifecycle callback methods were invoked on the listener...
            mock.Verify();
        }
Esempio n. 2
0
        public void RemoveAdvisedSupportListener()
        {
            IAdvisedSupportListener listener = A.Fake <IAdvisedSupportListener>();

            ProxyFactory factory = new ProxyFactory(new TestObject());

            factory.AddListener(listener);
            factory.RemoveListener(listener);

            factory.GetProxy();

            // check that no lifecycle callback methods were invoked on the listener...
            A.CallTo(() => listener.Activated(null)).WithAnyArguments().MustNotHaveHappened();
            A.CallTo(() => listener.AdviceChanged(null)).WithAnyArguments().MustNotHaveHappened();
            A.CallTo(() => listener.InterfacesChanged(null)).WithAnyArguments().MustNotHaveHappened();
        }
        public void RemoveAdvisedSupportListener()
        {
            IAdvisedSupportListener listener = MockRepository.GenerateMock <IAdvisedSupportListener>();

            ProxyFactory factory = new ProxyFactory(new TestObject());

            factory.AddListener(listener);
            factory.RemoveListener(listener);

            factory.GetProxy();

            // check that no lifecycle callback methods were invoked on the listener...
            listener.AssertWasNotCalled(x => x.Activated(Arg <AdvisedSupport> .Is.Anything));
            listener.AssertWasNotCalled(x => x.AdviceChanged(Arg <AdvisedSupport> .Is.Anything));
            listener.AssertWasNotCalled(x => x.InterfacesChanged(Arg <AdvisedSupport> .Is.Anything));
        }
Esempio n. 4
0
 public void RemoveNullAdvisedSupportListenerIsOk()
 {
     ProxyFactory factory = new ProxyFactory(new TestObject());
     factory.RemoveListener(null);
 }
Esempio n. 5
0
        public void RemoveAdvisedSupportListener()
        {
            IAdvisedSupportListener listener = MockRepository.GenerateMock<IAdvisedSupportListener>();

            ProxyFactory factory = new ProxyFactory(new TestObject());
            factory.AddListener(listener);
            factory.RemoveListener(listener);

            factory.GetProxy();

            // check that no lifecycle callback methods were invoked on the listener...
            listener.AssertWasNotCalled(x => x.Activated(Arg<AdvisedSupport>.Is.Anything));
            listener.AssertWasNotCalled(x => x.AdviceChanged(Arg<AdvisedSupport>.Is.Anything));
            listener.AssertWasNotCalled(x => x.InterfacesChanged(Arg<AdvisedSupport>.Is.Anything));
        }
Esempio n. 6
0
        public void RemoveNullAdvisedSupportListenerIsOk()
        {
            ProxyFactory factory = new ProxyFactory(new TestObject());

            factory.RemoveListener(null);
        }
Esempio n. 7
0
        public void RemoveAdvisedSupportListener()
        {
            IDynamicMock mock = new DynamicMock(typeof(IAdvisedSupportListener));
            IAdvisedSupportListener listener = (IAdvisedSupportListener)mock.Object;

            ProxyFactory factory = new ProxyFactory(new TestObject());
            factory.AddListener(listener);
            factory.RemoveListener(listener);

            factory.GetProxy();

            // check that no lifecycle callback methods were invoked on the listener...
            mock.Verify();
        }