Exemplo n.º 1
0
 public void Adding_Repeat_Will_Throw()
 {
     Assert.That(
         ThrewHelper.Threw <SequenceSetupException>(() =>
     {
         new SequenceInvocationIndices {
             1, 1
         };
     }, (e => e.RepeatedCallIndexInSetup))
         );
 }
Exemplo n.º 2
0
 public void Adding_Negative_Will_Throw()
 {
     Assert.That(
         ThrewHelper.Threw <SequenceSetupException>(() =>
     {
         new SequenceInvocationIndices {
             1, -1
         };
     }, (e => e.NegativeCallIndex))
         );
 }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
        public void Threw_With_Predicate_Should_Return_False_If_No_Exception()
        {
            var threw = ThrewHelper.Threw <Exception>(() => { }, (s => true));

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