public override IDescriptionWriter WriteTo(IDescriptionWriter writer)
 {
     writer.Write($"{Path ?? Selector}: ");
     result.WriteTo(writer);
     writer.WriteLine($" but was: {Token}");
     return writer.WriteLine();
 }
Beispiel #2
0
 public override IDescriptionWriter WriteTo(IDescriptionWriter writer)
 {
     writer.Write("When ");
     guard.WriteTo(writer);
     writer.Write(" then ");
     return(rule.WriteTo(writer));
 }
 public override IDescriptionWriter WriteTo(IDescriptionWriter writer)
 {
     writer.Write($"{Path ?? Selector}: ");
     result.WriteTo(writer);
     writer.WriteLine($" but was: {Token}");
     return(writer.WriteLine());
 }
Beispiel #4
0
 public TestCaseContext(IDictionary <string, string> options, TestCase testCase, IDisposableLogger logger, IDescriptionWriter descriptionWriter, IItemsHolder itemsHolder)
 {
     Options           = options;
     TestCase          = testCase;
     Logger            = logger;
     DescriptionWriter = descriptionWriter;
     _itemsHolder      = itemsHolder;
 }
 public override IDescriptionWriter WriteTo(IDescriptionWriter writer)
 {
     using (writer.Indent())
     {
         list.Aggregate(false, (joining, description) =>
         {
             if (joining)
                 writer.Write(join + " ");
             description.WriteTo(writer);
             return true;
         });
     }
     return writer;
 }
Beispiel #6
0
 public override IDescriptionWriter WriteTo(IDescriptionWriter writer)
 {
     using (writer.Indent())
     {
         list.Aggregate(false, (joining, description) =>
         {
             if (joining)
             {
                 writer.Write(join + " ");
             }
             description.WriteTo(writer);
             return(true);
         });
     }
     return(writer);
 }
Beispiel #7
0
        protected IDescriptionWriter JoinWriteTo(IDescriptionWriter writer, Func <JsonConstraintResult, bool> filter, string join)
        {
            //TODO: (jmd 2015-10-30) Delegate.
            IEnumerable <JsonConstraintResult> filtered = Results.Where(filter);

            using (writer.Indent())
            {
                filtered.Aggregate(false, (notFirst, result) =>
                {
                    if (notFirst)
                    {
                        writer.Write(join);
                    }

                    result.WriteTo(writer);
                    return(true);
                });
                return(writer);
            }
        }
 public override IDescriptionWriter WriteTo(IDescriptionWriter writer)
 {
     return writer.WriteLine($"{alias} should {constraint.Describe()}");
 }
 public override IDescriptionWriter WriteTo(IDescriptionWriter writer)
 {
     //TODO: (jmd 2015-10-26) Indentation?
     descriptions.ForEach(d => d.WriteTo(writer));
     return writer;
 }
Beispiel #10
0
 public override IDescriptionWriter WriteTo(IDescriptionWriter writer)
 {
     return(JoinWriteTo(writer, result => true, "and "));
 }
 public override IDescriptionWriter WriteTo(IDescriptionWriter writer)
 {
     return Description.WriteTo(writer);
 }
 public override IDescriptionWriter WriteTo(IDescriptionWriter writer)
 {
     return(writer.WriteLine($" should have matched: {Func}"));
 }
 public IDescriptionWriter WriteTo(IDescriptionWriter writer)
 {
     return(writer.WriteLine(ToString()));
 }
Beispiel #14
0
 public override IDescriptionWriter WriteTo(IDescriptionWriter writer)
 {
     //TODO: (jmd 2015-10-26) Indentation?
     descriptions.ForEach(d => d.WriteTo(writer));
     return(writer);
 }
 public override IDescriptionWriter WriteTo(IDescriptionWriter writer)
 {
     return JoinWriteTo(writer, result => true, "and ");
 }
 public override IDescriptionWriter WriteTo(IDescriptionWriter writer)
 {
     return(Result.WriteTo(writer.Write("not ")));
 }
 public IDescriptionWriter WriteTo(IDescriptionWriter writer)
 {
     return writer.WriteLine(ToString());
 }
Beispiel #18
0
 public override IDescriptionWriter WriteTo(IDescriptionWriter writer)
 {
     return(JoinWriteTo(writer, result => !result.Value, "or "));
 }
 public override IDescriptionWriter WriteTo(IDescriptionWriter writer)
 {
     return JoinWriteTo(writer, result => !result.Value, "or ");
 }
 public override IDescriptionWriter WriteTo(IDescriptionWriter writer)
 {
     return writer.WriteLine($" should have matched: {Func}");
 }
Beispiel #21
0
 public abstract IDescriptionWriter WriteTo(IDescriptionWriter writer);
Beispiel #22
0
 public override IDescriptionWriter WriteTo(IDescriptionWriter writer)
 {
     return(writer.WriteLine($"{alias} should {constraint.Describe()}"));
 }
Beispiel #23
0
 public override IDescriptionWriter WriteTo(IDescriptionWriter writer)
 {
     return(writer.WriteLine($"not {inner}"));
 }
 public override IDescriptionWriter WriteTo(IDescriptionWriter writer)
 {
     writer.Write("When ");
     guard.WriteTo(writer);
     writer.Write(" then ");
     return rule.WriteTo(writer);
 }
 public override IDescriptionWriter WriteTo(IDescriptionWriter writer)
 {
     return Result.WriteTo(writer.Write("not "));
 }
 public override IDescriptionWriter WriteTo(IDescriptionWriter writer)
 {
     return writer;
 }
Beispiel #27
0
 public override IDescriptionWriter WriteTo(IDescriptionWriter writer)
 {
     return(results.Aggregate(writer, (w, r) => r.WriteTo(w)));
 }
 public override IDescriptionWriter WriteTo(IDescriptionWriter writer)
 {
     return writer.WriteLine($"not {inner}");
 }
 public override IDescriptionWriter WriteTo(IDescriptionWriter writer)
 {
     return(Description.WriteTo(writer));
 }
Beispiel #30
0
 public abstract IDescriptionWriter WriteTo(IDescriptionWriter writer);