public void WhenAddingProxyBehavior_ThenCanAddLambda() { var proxy = new TestProxy(); proxy.AddProxyBehavior((m, n) => null); Assert.Equal(1, proxy.Behaviors.Count); }
public void WhenAddingProxyBehaviorToObject_ThenCanAddInterface() { object proxy = new TestProxy(); proxy.AddProxyBehavior(new TestProxyBehavior()); Assert.Equal(1, ((IProxy)proxy).Behaviors.Count); }
public void WhenAddingProxyBehaviorToObject_ThenCanAddLambda() { object proxy = new TestProxy(); proxy.AddProxyBehavior((m, n) => null); Assert.Equal(1, ((IProxy)proxy).Behaviors.Count); }
public void WhenAddingProxyBehavior_ThenCanAddInterface() { var proxy = new TestProxy(); proxy.AddProxyBehavior(new TestProxyBehavior()); Assert.Equal(1, proxy.Behaviors.Count); }
public void WhenInsertingProxyBehaviorToObject_ThenCanAddLambda() { object proxy = new TestProxy(); proxy.AddProxyBehavior((m, n) => null); proxy.InsertProxyBehavior(0, (m, n) => throw new NotImplementedException()); Assert.Equal(2, ((IProxy)proxy).Behaviors.Count); Assert.Throws <NotImplementedException>(() => ((IProxy)proxy).Behaviors[0].Invoke(null, null)); }
public void WhenInsertingProxyBehaviorToObject_ThenCanAddInterface() { object proxy = new TestProxy(); var behavior = new TestProxyBehavior(); proxy.AddProxyBehavior((m, n) => null); proxy.InsertProxyBehavior(0, behavior); Assert.Equal(2, ((IProxy)proxy).Behaviors.Count); Assert.Same(behavior, ((IProxy)proxy).Behaviors[0]); }