예제 #1
0
        public void Main()
        {
            channel = new HttpChannel(0);
            ChannelServices.RegisterChannel(channel);
            MarshalByRefObject obj = (MarshalByRefObject)RemotingServices.Connect(
                typeof(IFactorial),
                "http://localhost:60000/MyEndPoint");
            IFactorial cal = (IFactorial)obj;

            Assert.AreEqual(cal.CalculateFactorial(4), 24);
        }
예제 #2
0
        public void Main()
        {
            Hashtable props = new Hashtable();

            props["port"]   = 0;
            props["bindTo"] = "127.0.0.1";
            channel         = new HttpChannel(props, null, null);
            ChannelServices.RegisterChannel(channel);
            MarshalByRefObject obj = (MarshalByRefObject)RemotingServices.Connect(
                typeof(IFactorial),
                $"http://127.0.0.1:{server.HttpPort}/MyEndPoint");
            IFactorial cal = (IFactorial)obj;

            Assert.AreEqual(cal.CalculateFactorial(4), 24);
        }
예제 #3
0
 public Manager(IFibonacci fibonacci, IFactorial factorial, List <Animal> animals)
 {
     _fibonacci = fibonacci;
     _factorial = factorial;
     _animals   = animals;
 }
 public void Startup()
 {
     testLib = Substitute.For <MathLib>();
 }
예제 #5
0
 public CalculationEngine(IMean <Int32> meanCalc, IFactorial <int> factCalc)
 {
     _meanCalc = meanCalc;
     _factCalc = factCalc;
 }
 public FactorialDigitSum(IFactorial factorialService)
 {
     _factorialService = factorialService;
 }