public static void AssertText(string expected, string actual, IApprovalFailureReporter reporter = null)
 {
     if (reporter == null)
     {
         reporter = Approvals.GetReporter(DiffReporter.INSTANCE);
     }
     reporter = new MultiReporter(reporter, InlineTextReporter.INSTANCE);
     StringReporting.AssertEqual(expected, actual, reporter);
 }
Beispiel #2
0
 protected void Approve(string message)
 {
     Approvals.Verify(new ApprovalTextWriter(message), new ConventionTestNamer(GetType().Name),
                      Approvals.GetReporter());
 }
            /// <summary>
            /// Moves the engine to the next combination.
            /// </summary>
            /// <returns>True if there was another combination to return, false if no more combinations are available.</returns>
            public bool NextCombination()
            {
                if (this.currentDimensionValues == null)
                {
                    this.currentDimensionValues = new Dictionary <string, object>(this.dimensions.Count);
                    for (int i = 0; i < this.dimensions.Count; i++)
                    {
                        this.currentDimensionIndices[i] = 0;
                    }
                }
                else
                {
                    for (int index = this.currentDimensionIndices.Length - 1; index >= 0; index--)
                    {
                        this.currentDimensionIndices[index]++;
                        if (this.currentDimensionIndices[index] == this.dimensions[index].Values.Count)
                        {
                            this.currentDimensionIndices[index] = 0;
                            if (index == 0)
                            {
#if !SILVERLIGHT
                                string baseline = baselineCallback();
                                if (!skipVerify && !string.IsNullOrEmpty(baseline))
                                {
                                    if (approvalFileSoucePath != null)
                                    {
                                        Approvals.Verify(new ApprovalTextWriter(baseline), new CustomSourcePathNamer(approvalFileSoucePath), Approvals.GetReporter());
                                    }
                                    else
                                    {
                                        Approvals.Verify(baseline);
                                    }
                                }
#endif
                                return(false);
                            }
                        }
                        else
                        {
                            break;
                        }
                    }
                }

                // Set the parameters
                for (int i = 0; i < this.dimensions.Count; i++)
                {
                    this.currentDimensionValues[this.dimensions[i].Name] = this.dimensions[i].Values[this.currentDimensionIndices[i]];
                }

                return(true);
            }