Exemple #1
0
        public void ResultLoggerTests()
        {
            var logWriter  = MockRepository.GenerateStrictMock <IOutputWriter>();
            var failWriter = MockRepository.GenerateStrictMock <IOutputWriter>();

            logWriter.Expect(l => l.WriteLine(Arg <string> .Matches(p => p.EndsWith("No Failure."))));
            logWriter.Expect(l => l.WriteLine(Arg <string> .Matches(p => p.EndsWith("Failure begin."))));
            logWriter.Expect(l => l.WriteLine(Arg <string> .Matches(p => p.EndsWith("Failure continuing."))));
            logWriter.Expect(l => l.WriteLine(Arg <string> .Matches(p => p.Contains("Connection restored. Outage Duration: "))));
            logWriter.Expect(l => l.WriteLine(Arg <string> .Matches(p => p.EndsWith("No Failure."))));

            failWriter.Expect(l => l.WriteLine(Arg <string> .Matches(p => p.Contains("Connection Restored. Begin: "))));

            var resultLogger = new ResultLogger(logWriter, failWriter);

            resultLogger.Log(DateTime.Now, true);
            resultLogger.Log(DateTime.Now, false);
            resultLogger.Log(DateTime.Now, false);
            resultLogger.Log(DateTime.Now, true);
            resultLogger.Log(DateTime.Now, true);
        }
Exemple #2
0
 /// <summary>
 /// Logs push message error.
 /// </summary>
 protected void Log(MessageSendException exception)
 {
     ResultLogger.Log(DisplayName, exception);
 }
Exemple #3
0
 /// <summary>
 /// Logs push message result.
 /// </summary>
 protected void Log(MessageSendResult result)
 {
     ResultLogger.Log(DisplayName, result);
 }