Beispiel #1
0
 public void Adding_Repeat_Will_Throw()
 {
     Assert.That(
         ThrewHelper.Threw <SequenceSetupException>(() =>
     {
         new SequenceInvocationIndices {
             1, 1
         };
     }, (e => e.RepeatedCallIndexInSetup))
         );
 }
Beispiel #2
0
 public void Adding_Negative_Will_Throw()
 {
     Assert.That(
         ThrewHelper.Threw <SequenceSetupException>(() =>
     {
         new SequenceInvocationIndices {
             1, -1
         };
     }, (e => e.NegativeCallIndex))
         );
 }
        public bool Should_Return_True_When_Action_Throws(bool throws)
        {
            Action action = null;

            if (throws)
            {
                action = () => throw new Exception();
            }
            else
            {
                action = () => { };
            }
            return(ThrewHelper.Threw(action));
        }
        public void Threw_With_Predicate_Should_Return_False_If_No_Exception()
        {
            var threw = ThrewHelper.Threw <Exception>(() => { }, (s => true));

            Assert.That(threw, Is.False);
        }
 public void With_Generic_Should_Return_False_If_Does_Not_Throw()
 {
     Assert.That(() => ThrewHelper.Threw <SystemException>(() => { }), Is.False);
 }