コード例 #1
0
        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);
            });
        }
コード例 #2
0
 float RemoteOperation(IDummyProxyable someProxyable)
 {
     return(someProxyable.PassInput(expected));
 }
コード例 #3
0
 protected float FailingRemoteOperation(IDummyProxyable someProxyable)
 {
     throw expectedEx;
 }
コード例 #4
0
 protected float SuccessfulRemoteOperation(IDummyProxyable someProxyable)
 {
     return(someProxyable.PassInput(successfulResult));
 }