public void StopClosesCommunications()
 {
     var cleaned = false;
     var channel = new ChannelStub
                       {
                           OnCleanUpAction = () => cleaned = true
                       };
     var server = new Server("Test", new[] { channel });
     var application = new Application
                           {
                               Configuration = server
                           };
     application.Stop();
     Assert.IsTrue(cleaned);
 }
Exemplo n.º 2
0
 public void CloseCommunicationsCleansUpEachChannel()
 {
     var cleaned = false;
     var channel = new ChannelStub
                       {
                           OnCleanUpAction = () => cleaned = true
                       };
     var server = new Server("Test", new[] { channel });
     server.CloseCommunications();
     Assert.IsTrue(cleaned);
 }
 public void StartOpensCommunications()
 {
     var initialised = false;
     var channel = new ChannelStub
                       {
                           OnInitialiseAction = () => initialised = true
                       };
     var server = new Server("Test", new[] { channel });
     var application = new Application
                           {
                               Configuration = server
                           };
     application.Start();
     Assert.IsTrue(initialised);
 }
Exemplo n.º 4
0
 public void OpenCommunicationsInitialisesEachChannel()
 {
     var initialised = false;
     var channel = new ChannelStub
                       {
                           OnInitialiseAction = () => initialised = true
                       };
     var server = new Server("Test", new[] { channel })
                      {
                          ActionInvoker = new ActionInvoker()
                      };
     server.OpenCommunications();
     Assert.IsTrue(initialised);
     Assert.AreSame(server.ActionInvoker, channel.Invoker);
 }