private void VerifyLogMessages(global::Bromine.Logger.LogBase log) { var uniqueMessageCount = Regex.Matches(ReadLogFromFile(log), Message).Count; Assert.Equal(1, uniqueMessageCount); Assert.Equal(1, MessageCount); }
/// <summary> /// Read the log for the current test. /// </summary> /// <returns></returns> public string ReadLogFromFile(global::Bromine.Logger.LogBase log) { MessageCount = 0; var builder = new StringBuilder(); if (File.Exists(log.LogPath)) { using (var reader = new StreamReader(log.LogPath)) { string line; while ((line = reader.ReadLine()) != null) { MessageCount++; builder.AppendLine(line); } } } return(builder.ToString()); }