コード例 #1
0
        public void SetUp()
        {
            try
            {
                Tester = new ServiceTester <CalculatorServiceHost>
                {
                    CommunicationKernel = new MicrodotInitializer(
                        "CalculatorServiceCommLayer",
                        new ConsoleLogLoggersModules(),
                        k =>
                    {
                        k.Rebind <ICacheRevoker>().ToConstant(_fakeRevokingManager);
                        k.Rebind <IRevokeListener>().ToConstant(_fakeRevokingManager);
                        k.Rebind <ICertificateLocator>().To <DummyCertificateLocator>().InSingletonScope();
                    }
                        ).Kernel
                };

                Service            = Tester.GetServiceProxy <ICalculatorService>();
                ServiceWithCaching = Tester.GetServiceProxyWithCaching <ICalculatorService>();
                ProxyProvider      = Tester.GetServiceProxyProvider("CalculatorService");
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
        }
コード例 #2
0
        public void TestFixtureSetUp()
        {
            _serviceTester = new ServiceTester <CalculatorServiceHost>();

            _serviceProxy = _serviceTester.GetServiceProxy <ICalculatorService>();

            _flumeQueue = (SpyEventPublisher)_serviceTester.Host.Kernel.Get <IEventPublisher>();
        }
コード例 #3
0
ファイル: HostTests.cs プロジェクト: zxw-ing/microdot
        public void HostShouldStartAndStopMultipleTimes()
        {
            _counter++;
            Stopwatch sw = Stopwatch.StartNew();

            Console.WriteLine($"-----------------------------Start run {_counter} time---------------");
            try
            {
                var host = new ServiceTester <TestHost>();
                host.GetServiceProxy <ICalculatorService>();
                Console.WriteLine($"-----------------------------Silo Is running {_counter} time took, {sw.ElapsedMilliseconds}ms---------------");
                host.Dispose();
            }
            finally
            {
                Console.WriteLine(
                    $"-----------------------------End run {_counter} time, took {sw.ElapsedMilliseconds}ms  ---------------");
            }
        }