Пример #1
0
            public override TestFailure Should(ITestMatcher <T> matcher)
            {
                var s          = Stopwatch.StartNew();
                var durationMS = (int)_duration.TotalMilliseconds;

                do
                {
                    var aFailure = _inner.Should(matcher);
                    if (aFailure != null)
                    {
                        var result = new TestFailure("spec.consistently")
                        {
                            Message  = SR.ConsistentlyElapsedBefore(((Time)_duration).ToString("n")),
                            Children =
                            {
                                TestMatcherLocalizer.FailurePredicate(matcher)
                            },
                        };
                        result.UserData.CopyActuals(aFailure.UserData);
                        return(result);
                    }
                } while (s.ElapsedMilliseconds <= durationMS);

                return(null);
            }
Пример #2
0
            public sealed override TestFailure Should(ITestMatcher <object> matcher)
            {
                _real = matcher;
                var _ = _inner.Should(this);

                return(Result);
            }
 public override TestFailure Should(ITestMatcher <T> matcher)
 {
     if (_comparer != null)
     {
         matcher = ((ITestMatcherWithComparer <T>)matcher).WithComparer(_comparer);
     }
     return(_inner.Should(matcher));
 }
Пример #4
0
        internal static void Should <T>(this ExpectationCommand <T> self, ITestMatcher <T> matcher, string message = null, object[] args = null)
        {
            var failure = self.Should(matcher);

            if (failure != null)
            {
                AsserterBehavior behavior = failure.AsserterBehavior;
                behavior.Assert(failure.UpdateTestSubject().UpdateMessage(message, args));
            }
        }
Пример #5
0
 public void Like(ITestMatcher matcher, string message = null, object[] args = null)
 {
     _cmd.Should(matcher, message, args);
 }
Пример #6
0
 public void Like(ITestMatcher <IEnumerable> matcher, string message = null, object[] args = null)
 {
     _cmd.Should(matcher, message, (object[])args);
 }
Пример #7
0
 public void To(ITestMatcher matcher, string message = null, params object[] args)
 {
     _cmd.Should(matcher, message, args);
 }
Пример #8
0
 public void Like(ITestMatcher matcher, string message, params object[] args)
 {
     _cmd.Should(matcher, message, (object[])args);
 }