public virtual void before_each() { autoSubstitute = new AutoSubstitute(); targetDomain = autoSubstitute.Resolve <ITargetAppDomain>(); appDomainFactory = autoSubstitute.Resolve <IAppDomainFactory>(); appDomainFactory.Create(somePath).Returns(targetDomain); proxyable = autoSubstitute.Resolve <IDummyProxyable>(); proxyableFactory = autoSubstitute.Resolve <IProxyableFactory <IDummyProxyable> >(); proxyableFactory.CreateProxy(targetDomain).Returns(proxyable); runner = new CrossDomainRunner <IDummyProxyable, float>(appDomainFactory, proxyableFactory); proxyable.PassInput(Arg.Any <float>()).Returns(callInfo => { float input = callInfo.Arg <float>(); return(input); }); }
float RemoteOperation(IDummyProxyable someProxyable) { return(someProxyable.PassInput(expected)); }
protected float FailingRemoteOperation(IDummyProxyable someProxyable) { throw expectedEx; }
protected float SuccessfulRemoteOperation(IDummyProxyable someProxyable) { return(someProxyable.PassInput(successfulResult)); }