コード例 #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
ファイル: Manager.cs プロジェクト: Aleksanrda/Education
 public Manager(IFibonacci fibonacci, IFactorial factorial, List <Animal> animals)
 {
     _fibonacci = fibonacci;
     _factorial = factorial;
     _animals   = animals;
 }
コード例 #4
0
 public void Startup()
 {
     testLib = Substitute.For <MathLib>();
 }
コード例 #5
0
 public CalculationEngine(IMean <Int32> meanCalc, IFactorial <int> factCalc)
 {
     _meanCalc = meanCalc;
     _factCalc = factCalc;
 }
コード例 #6
0
 public FactorialDigitSum(IFactorial factorialService)
 {
     _factorialService = factorialService;
 }