Inheritance: PublisherBase
Exemplo n.º 1
0
 public void SendMessageToRemoteHost_Should_Call_SendToSignalR()
 {
     var publisher = new FakePublisher();
     publisher.SetConnected();
     publisher.Execute_SendTheMessageToRemoteHost(SignalRConnector.LogLevel.Debug, new[] {"Some Message"});
     Assert.IsTrue(publisher.HasSignalSent);
 }
Exemplo n.º 2
0
        public void WriteToQueue_Should_Queue_Functions_To_Execute_If_Client_Is_Not_Connected()
        {
            var publisher = new FakePublisher();
            publisher.SetDisconnected();
            publisher.WriteToQueue(SignalRConnector.LogLevel.Debug, "Some Message");

            Assert.IsTrue(publisher.NumberOfFunctionsToExecute == 1);
        }
Exemplo n.º 3
0
        public void StartProcessing_Should_Deque_Functions_When_Queue_Has_Any_Function()
        {
            var publisher = new FakePublisher();
            publisher.SetDisconnected();
            publisher.WriteToQueue(SignalRConnector.LogLevel.Debug, "Some Message");
            publisher.WriteToQueue(SignalRConnector.LogLevel.Error, "Some Message");
            publisher.WriteToQueue(SignalRConnector.LogLevel.Warn, "Some Message");
            publisher.WriteToQueue(SignalRConnector.LogLevel.Info, "Some Message");
            Assert.IsTrue(publisher.NumberOfFunctionsToExecute == 4);

            publisher.Execute_StartProcessing();

            Assert.IsTrue(publisher.NumberOfFunctionsToExecute == 0);
        }