コード例 #1
0
 public static LogEntryTestDataBuilder TestAgainstLogEntry(LogEntryTime time = LogEntryTime.Source, LogEntryMsg msg = LogEntryMsg.Source, string userMsg = null)
 {
     return(TestAgainst(LogEntryBuilder.LogEntry(time, msg, userMsg).Build()));
 }
コード例 #2
0
        public static LogEntryBuilder LogEntry(LogEntryTime time = LogEntryTime.Source, LogEntryMsg msg = LogEntryMsg.Source, string userMsg = null)
        {
            DateTime timestamp;

            switch (time)
            {
            case LogEntryTime.Source:
                timestamp = sourceDataTime;
                break;

            case LogEntryTime.Test:
                timestamp = testDataTime;
                break;

            case LogEntryTime.Now:
            default:
                timestamp = DateTime.Now;
                break;
            }

            string logMsg;

            switch (msg)
            {
            case LogEntryMsg.Source:
                logMsg = "source-msg";
                break;

            case LogEntryMsg.Test:
                logMsg = "test-msg";
                break;

            case LogEntryMsg.User:
            default:
                logMsg = userMsg;
                break;
            }

            return(new LogEntryBuilder(new LogEntry(timestamp, logMsg)));
        }