Пример #1
0
        private void AppendExtraLineText(TableDifferenceResults <T> tableDifferenceResults, TableDifferenceItem <T> item, StringBuilder realData)
        {
            var line = "+ |";

            foreach (var header in tableDifferenceResults.Table.Header)
            {
                object value = GetTheValue(item.Item, header);

                if (value is DateTime)
                {
                    DateTime dateValue = (DateTime)value;

                    // Append millisecond and ticks, if any, to current culture's default date time format
                    string dateTimeFormat = DateTimeFormatInfo.CurrentInfo.ShortDatePattern + " " + DateTimeFormatInfo.CurrentInfo.LongTimePattern;
                    dateTimeFormat = Regex.Replace(dateTimeFormat, "(:ss|:s)", "$1.FFFFFFF");
                    value          = dateValue.ToString(dateTimeFormat);
                }

                line += $" {value} |";
            }

            realData.AppendLine(line);
        }
Пример #2
0
        private void AppendExtraLineText(TableDifferenceResults <T> tableDifferenceResults, TableDifferenceItem <T> item, StringBuilder realData)
        {
            var line = "+ |";

            foreach (var header in tableDifferenceResults.Table.Header)
            {
                line += $" {GetTheValue(item.Item, header)} |";
            }
            realData.AppendLine(line);
        }