示例#1
0
        public string FormatResult(ContentsResult result)
        {
            var sb = new StringBuilder();

            sb.Append(result.FileName);
            if (result.FileLine > 0)
            {
                sb.AppendFormat(":{0}{1}", result.FileLine, Environment.NewLine);
            }
            else
            {
                sb.AppendLine();
            }
            if (result.CaptureGroups != null && result.CaptureGroups.Count() > 1)
            {
                for (int i = 0; i < result.CaptureGroups.Count(); i++)
                {
                    sb.AppendFormat("\t[{0}]:{1}{2}", i, result.CaptureGroups.ElementAt(i), Environment.NewLine);
                }
            }
            return(sb.ToString());
        }
示例#2
0
 private static void AssertItems(ContentsResult <TestEntity, TestEntityData> entities, int total, int[] expected)
 {
     Assert.Equal(total, entities.Total);
     Assert.Equal(expected, entities.Items.Select(x => x.Data.Number).ToArray());
 }