Exemple #1
0
 public async Task <IActionResult> TestDisposed()
 {
     //var temp = ServiceLocator.Instance.GetService<IProcessingServer>();
     //temp.Dispose();
     ProcessingServer.Dispose();
     return(Success());
 }
        public void ProcessingServer_Dispose_Uninitialized()
        {
            var factory = new Mock <IEventBusFactory>();
            var server  = new ProcessingServer(factory.Object);

            Assert.DoesNotThrow(() => server.Dispose());
        }
        public void ProcessingServer_Dispose_RegisterFactory()
        {
            var factory = new Mock <IEventBusFactory>();
            var server  = new ProcessingServer(factory.Object);

            server.Register("pipeline", () => (EventPipeline)null);

            Assert.DoesNotThrow(() => server.Dispose());
        }
        public void ProcessingServer_Dispose_RegisterEventBus()
        {
            var factory = new Mock <IEventBusFactory>();
            var server  = new ProcessingServer(factory.Object);

            var bus = new Mock <IEventBus>();

            bus.Setup(exp => exp.PipelineId).Returns("pipeline");

            server.Register("pipeline", bus.Object);

            Assert.DoesNotThrow(() => server.Dispose());
        }