Exemplo n.º 1
0
        //----------------------------------------- Events

        public void NotifyStatusMessage(string args)
        {
            StatusMessageHandler handler = StatusMessageSubscribers;

            if (handler != null)
            {
                handler(args);
            }
        }
Exemplo n.º 2
0
        //notify subscribers (statusbar) that a message has to be logged
        public void NotifyStatusMessage(string args)
        {
            StatusMessageHandler handler = StatusMessageSubscribers;

            if (handler != null)
            {
                handler(string.Format("[{0:G}]: " + args + "\n", System.DateTime.Now));
            }
        }
        public StatusMessageHandlerTests()
        {
            mediator      = A.Fake <IMediator>();
            sender        = A.Fake <IMessagesSender>();
            backupServers = A.Fake <IBackupServerManager>();
            client        = A.Fake <ITcpClient>();
            dispatcher    = A.Fake <IProblemDispatcher>();
            backupSender  = A.Fake <IBackupSender>();

            A.CallTo(() => client.GetStream()).Returns(A.Fake <INetworkStream>());
            A.CallTo(() => backupServers.BackupServers).Returns(SampleServers);
            A.CallTo(() => dispatcher.GetWorkForNode(0)).WithAnyArguments().Returns(null);

            handler = new StatusMessageHandler(sender, mediator, backupServers, dispatcher, backupSender);
        }