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(); }
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)); }
public void RemoveNullAdvisedSupportListenerIsOk() { ProxyFactory factory = new ProxyFactory(new TestObject()); factory.RemoveListener(null); }
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)); }