Ejemplo n.º 1
0
        public void Positive_MultiplePreconditionsMethod_ThrowsIfAnyArgNegative()
        {
            var demo = new PositiveConsumer();

            Assert.Throws <PreconditionException>(() =>
                                                  demo.MultiplePreconditionsMethod(1, -1));

            Assert.Throws <PreconditionException>(() =>
                                                  demo.MultiplePreconditionsMethod(-1, 1));
        }
Ejemplo n.º 2
0
        public void Positive_MultiplePreconditionsMethod_DoesNotThrowIfArgsPositive()
        {
            var demo = new PositiveConsumer();

            Assert.DoesNotThrow(() =>
                                demo.MultiplePreconditionsMethod(1, 3.14));
        }