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; } }
public void TestFixtureSetUp() { _serviceTester = new ServiceTester <CalculatorServiceHost>(); _serviceProxy = _serviceTester.GetServiceProxy <ICalculatorService>(); _flumeQueue = (SpyEventPublisher)_serviceTester.Host.Kernel.Get <IEventPublisher>(); }
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 ---------------"); } }